diff --git a/package-lock.json b/package-lock.json index aea64639cf..28f9801895 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4531,9 +4531,9 @@ } }, "commander": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", - "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==" + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.0.0.tgz", + "integrity": "sha512-ovx/7NkTrnPuIV8sqk/GjUIIM1+iUQeqA3ye2VNpq9sVoiZsooObWlQy+OPWGI17GDaEoybuAGJm6U8yC077BA==" }, "component-bind": { "version": "1.0.0", @@ -12780,6 +12780,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true + }, "cosmiconfig": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", diff --git a/package.json b/package.json index c94ea9d1f1..83ee009058 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "bootstrap": "^3.4.1", "bootstrap-colorpicker": "^2.5.3", "buffer": "~6.0.2", - "commander": "^6.2.0", + "commander": "^7.0.0", "compressorjs": "^1.0.5", "data-uri-to-buffer": "^3.0.0", "downloadjs": "^1.4.7", diff --git a/src/cli/index.js b/src/cli/index.js index 918eb11953..35261b5914 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -1,7 +1,7 @@ require('../ImageSequencer'); sequencer = ImageSequencer({ ui: true }); var fs = require('fs'); -var program = require('commander'); +var { Command } = require('commander'); var utils = require('../CliUtils'); var saveSequence = require('./saveSequence.js'); @@ -73,6 +73,9 @@ function parseSteps(program) { } function cli(args) { + + let program = new Command(); + program .version('0.1.0') .option('-i, --image [PATH/URL]', 'Input image URL') @@ -90,9 +93,10 @@ function cli(args) { ) .parse(args); - if (program.saveSequence) saveSequence(program, sequencer); - else if (program.installModule) installModule(program, sequencer); - else parseSteps(program); + const options = program.opts(); + if (options.saveSequence) saveSequence(options, sequencer); + else if (options.installModule) installModule(options, sequencer); + else parseSteps(options); } module.exports = cli; diff --git a/yarn.lock b/yarn.lock index 1515c672bc..b78a61bba2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2430,6 +2430,11 @@ commander@^6.2.0: resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.0.tgz#b990bfb8ac030aedc6d11bc04d1488ffef56db75" integrity sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q== +commander@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.0.0.tgz#3e2bbfd8bb6724760980988fb5b22b7ee6b71ab2" + integrity sha512-ovx/7NkTrnPuIV8sqk/GjUIIM1+iUQeqA3ye2VNpq9sVoiZsooObWlQy+OPWGI17GDaEoybuAGJm6U8yC077BA== + commander@~2.13.0: version "2.13.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"