Files
allsochen 79f99bd4f1 feat: major rehaul of the preferences!
closes #351

BREAKING CHANGE: The old preferences panel has been replaced with a brand new one

Preferences are now much simpler, full of visual illustrations, and should provide a much better experience. Pick between 3 styles (thumbnails, app-icons, titles), sizes, dark/light themes, high visibility options, and more!
2024-10-10 11:19:39 +02:00

24 lines
891 B
JavaScript

const fs = require('fs');
const path = require('path');
const glob = require('glob');
const { execFileSync } = require('child_process');
const ignoreFilePath = path.join(__dirname, '..', '.swiftformatignore');
const ignorePatterns = fs.readFileSync(ignoreFilePath, 'utf8')
.split('\n')
.map(line => line.trim()) // Remove leading and trailing whitespace
.filter(line => line && !line.startsWith('#')); // Filter out empty lines and comments
const files = glob.sync('**/*.swift', { ignore: ignorePatterns });
if (files.length > 0) {
const commandArgs = process.argv.slice(2).concat(files);
try {
execFileSync('swiftformat', commandArgs, { stdio: 'inherit' });
} catch (error) {
console.warn('swiftformat did not pass, please execute `npm run format` command to format swift files.');
}
} else {
console.log('No Swift files to format.');
}