mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-39314 Break dependencies on the "commander" lib in the CLI (#11299)
This commit is contained in:
+15
-3
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
const minimist = require('minimist');
|
||||
const { parseArgs } = require('node:util');
|
||||
const { resolve, join } = require('node:path');
|
||||
const { readFileSync, existsSync } = require('node:fs');
|
||||
const { argv, exit, env, cwd } = require('node:process');
|
||||
@@ -10,10 +10,22 @@ function printHelp() {
|
||||
console.log(`${name} v${version}`);
|
||||
}
|
||||
|
||||
const args = minimist(argv.slice(2), {
|
||||
boolean: ['verbose']
|
||||
const { values, positionals } = parseArgs({
|
||||
args: argv.slice(2),
|
||||
options: {
|
||||
verbose: {
|
||||
type: 'boolean'
|
||||
}
|
||||
},
|
||||
allowPositionals: true,
|
||||
strict: false
|
||||
});
|
||||
|
||||
const args = {
|
||||
...values,
|
||||
_: positionals
|
||||
};
|
||||
|
||||
if (args._.length === 0) {
|
||||
printHelp();
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user