Skip to content

Commit

Permalink
fix(packages/sui-helpers): show commander help only if provided from …
Browse files Browse the repository at this point in the history
…param
  • Loading branch information
midudev committed Mar 30, 2021
1 parent 88ede65 commit 71943a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions packages/sui-helpers/cli.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -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)
}

Expand Down
1 change: 0 additions & 1 deletion packages/sui-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 71943a7

Please sign in to comment.