Skip to content

Commit 3a7d544

Browse files
committed
control no-spinner from env var
1 parent f95288f commit 3a7d544

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

bin/cli.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33

44
const path = require('path');
55
const process = require('process');
6-
const program = require('commander');
6+
const {Command, Option} = require('commander');
77
const rc = require('rc')('madge');
88
const version = require('../package.json').version;
99
const ora = require('ora');
1010
const chalk = require('chalk');
1111
const startTime = Date.now();
1212

13+
const program = new Command();
14+
1315
// Revert https://github.com/tj/commander.js/pull/1409
1416
program.storeOptionsAsProperties();
1517

@@ -34,7 +36,7 @@ program
3436
.option('--ts-config <file>', 'path to typescript config')
3537
.option('--include-npm', 'include shallow NPM modules', false)
3638
.option('--no-color', 'disable color in output and image', false)
37-
.option('--no-spinner', 'disable progress spinner', false)
39+
.addOption(new Option('--no-spinner', 'disable progress spinner', false).env('MADGE_NO_SPINNER'))
3840
.option('--stdin', 'read predefined tree from STDIN', false)
3941
.option('--warning', 'show warnings about skipped files', false)
4042
.option('--debug', 'turn on debug output', false)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
"dependencies": {
4747
"chalk": "^4.1.1",
48-
"commander": "^7.2.0",
48+
"commander": "^8.2.0",
4949
"commondir": "^1.0.1",
5050
"debug": "^4.3.1",
5151
"dependency-tree": "^9.0.0",

0 commit comments

Comments
 (0)