From 3a1f608f0b78561bb1c06e3b54a58e21f72940d5 Mon Sep 17 00:00:00 2001 From: Juan Picado Date: Sun, 28 Mar 2021 17:53:58 +0200 Subject: [PATCH] feat: upgrade to commander v7 (#2143) --- package.json | 2 +- src/lib/cli.ts | 12 +++++++----- yarn.lock | Bin 511448 -> 511448 bytes 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 2df9a4c39..be08882e7 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/lib/cli.ts b/src/lib/cli.ts index 0b0204d3e..a7b0579e8 100644 --- a/src/lib/cli.ts +++ b/src/lib/cli.ts @@ -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(); diff --git a/yarn.lock b/yarn.lock index fc553f22d8d845ffe258144fd41753c648829065..4b830dc6bc98b6285fe89fbcd8ff0e5fb5629351 100644 GIT binary patch delta 213 zcmW;GO=?0h6a`@V{3$q4T!D{{I#9{YP4beq+i(H7_a+G9NF3`x5TT<^-oP%SAgKGO z%W3G~8=Z6DJkFEHd9pt|{Z#te&ZzU+e%`C$u9@q(dKuI;FB7je+x1&b!YXmJNm~|e zV)n);a45(jhTs}+i6R>^A=;qOSr-BeLlWgV<&ycVod=6r`AC}B3L_H;X0i=tfwJS$ tNMm#f8$hGMI}$`_;nbbBi+eRX;;kw=MYrf(@Ya{#-v8sv_t*2s`yW;{K*j(7 delta 215 zcmW;GF-k*05P)H_CJGi>cz`^t#3Jm@?C#8}rJc10*qMEUAXZ|ng(vr1<#Tf4iJ-m-Cm`$+v@_;p1j{HoR}#(K9am0!|ORPVaiXe|&nl=zu+i8cPGr zK5OVPSTLZ}pjIvFkr7oeM(BMMDr_d&l9373U}BmjiRPM%aE4}#7AYZd&MCuK4uM4I4TKO`V*+VJb@;t@=fmyB9lzn)jrK;<(QJk5{q{H8J+Hn#53Vl%0cYhvkN^Mx