better cli arg supper

This commit is contained in:
2022-06-09 11:33:13 -05:00
parent e8de01b48a
commit ba1ca2fc83
7 changed files with 107 additions and 88 deletions

View File

@@ -11,6 +11,8 @@ const readmefile_1 = require("./readmefile");
const build_1 = __importDefault(require("./build"));
const CLIArgs = (0, command_line_args_1.default)([
{ name: 'watch', alias: 'w', type: Boolean },
{ name: 'minify', alias: 'm', type: Boolean },
{ name: 'prettier', alias: 'p', type: Boolean },
]);
//if package.json doesn't exist then there is no point in continuing
if (!(0, fs_1.existsSync)('package.json') || !(0, fs_1.lstatSync)('package.json').isFile()) {
@@ -36,7 +38,7 @@ for (let name of scripts) {
console.log('WATCH', name, meta.version);
(0, readmefile_1.updateReadmeFile)(scriptMeta);
}
let [meta, error] = (0, build_1.default)(name, CLIArgs.watch ? postWatchUpdate : false, PrettierConfig);
let [meta, error] = (0, build_1.default)(name, postWatchUpdate, PrettierConfig, CLIArgs);
scriptMeta[id] = { meta, error };
console.log(name, meta.version);
}