From 71943a7011494b324d938ff8b761f1051d3d3f13 Mon Sep 17 00:00:00 2001 From: midudev Date: Tue, 30 Mar 2021 12:23:47 +0200 Subject: [PATCH] fix(packages/sui-helpers): show commander help only if provided from param --- packages/sui-helpers/cli.js | 5 ++--- packages/sui-helpers/package.json | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/sui-helpers/cli.js b/packages/sui-helpers/cli.js index 1053be17a..9557e467e 100644 --- a/packages/sui-helpers/cli.js +++ b/packages/sui-helpers/cli.js @@ -1,5 +1,4 @@ /* eslint no-console:0 */ -const program = require('commander') const execa = require('execa') const {default: Queue} = require('p-queue') const path = require('path') @@ -141,9 +140,9 @@ function getCommandCallMessage(bin, args, options = {}) { * @param {String} msg * @param {Object} foreignProgram */ -const showError = (msg, foreignProgram = program) => { +const showError = (msg, foreignProgram) => { console.error(colors.red(`✖ Error: ${msg}\n`)) - foreignProgram.outputHelp(txt => txt) + foreignProgram && foreignProgram.outputHelp(txt => txt) process.exit(1) } diff --git a/packages/sui-helpers/package.json b/packages/sui-helpers/package.json index b0c796cc1..538e7f36e 100644 --- a/packages/sui-helpers/package.json +++ b/packages/sui-helpers/package.json @@ -4,7 +4,6 @@ "description": "A set of internal helpers used by sui-related packages.", "author": "", "dependencies": { - "commander": "6.2.1", "execa": "5.0.0", "fs-extra": "9.0.1", "p-queue": "6.6.2"