0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-30 22:34:10 -05:00

feat: upgrade to commander v7 (#2143)

This commit is contained in:
Juan Picado 2021-03-28 17:53:58 +02:00 committed by GitHub
parent 43f70437af
commit 3a1f608f0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View file

@ -27,7 +27,7 @@
"async": "3.2.0",
"body-parser": "1.19.0",
"bunyan": "1.8.15",
"commander": "3.0.2",
"commander": "7.2.0",
"compression": "1.7.4",
"cookies": "0.8.0",
"cors": "2.8.5",

View file

@ -41,13 +41,15 @@ commander
.version(pkgVersion)
.parse(process.argv);
const options = commander.opts();
function init() {
let verdaccioConfiguration;
let configPathLocation;
const cliListener = commander.listen;
const cliListener = options.listen;
try {
configPathLocation = findConfigFile(commander.config);
configPathLocation = findConfigFile(options.config);
verdaccioConfiguration = parseConfigFile(configPathLocation);
process.title = (verdaccioConfiguration.web && verdaccioConfiguration.web.title) || 'verdaccio';
@ -67,7 +69,7 @@ function init() {
}
}
if (commander.info) {
if (options.info) {
// eslint-disable-next-line no-console
console.log('\nEnvironment Info:');
(async () => {
@ -82,9 +84,9 @@ if (commander.info) {
console.log(data);
process.exit(0);
})();
} else if (commander.args.length == 1 && !commander.config) {
} else if (commander.args.length == 1 && !options.config) {
// handling "verdaccio [config]" case if "-c" is missing in command line
commander.config = commander.args.pop();
options.config = commander.args.pop();
init();
} else if (commander.args.length !== 0) {
commander.help();

BIN
yarn.lock

Binary file not shown.