Skip to content

Commit

Permalink
install and use ci-info
Browse files Browse the repository at this point in the history
  • Loading branch information
todor-a committed Feb 3, 2023
1 parent 3a7d544 commit c35da47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@

const path = require('path');
const process = require('process');
const {Command, Option} = require('commander');
const program = require('commander');
const rc = require('rc')('madge');
const version = require('../package.json').version;
const ora = require('ora');
const chalk = require('chalk');
const startTime = Date.now();

const program = new Command();
const ci = require('ci-info');

// Revert https://github.com/tj/commander.js/pull/1409
program.storeOptionsAsProperties();
Expand All @@ -36,7 +35,7 @@ program
.option('--ts-config <file>', 'path to typescript config')
.option('--include-npm', 'include shallow NPM modules', false)
.option('--no-color', 'disable color in output and image', false)
.addOption(new Option('--no-spinner', 'disable progress spinner', false).env('MADGE_NO_SPINNER'))
.option('--no-spinner', 'disable progress spinner', false)
.option('--stdin', 'read predefined tree from STDIN', false)
.option('--warning', 'show warnings about skipped files', false)
.option('--debug', 'turn on debug output', false)
Expand Down Expand Up @@ -77,7 +76,8 @@ const spinner = ora({
text: 'Finding files',
color: 'white',
interval: 100000,
isEnabled: program.spinner
isEnabled: !ci.isCI && program.spinner,
isSilent: ci.isCI
});

let exitCode = 0;
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"debug": "node bin/cli.js --debug bin lib",
"generate": "npm run generate:small && npm run generate:madge",
"generate:small": "bin/cli.js --image /tmp/simple.svg test/cjs/circular/a.js",
"generate:madge": "bin/cli.js --image /tmp/madge.svg bin lib",
"generate:madge": "export CI=true; bin/cli.js --image /tmp/madge.svg bin lib",
"test:output": "./test/output.sh",
"release": "npm test && release-it"
},
Expand All @@ -45,7 +45,8 @@
},
"dependencies": {
"chalk": "^4.1.1",
"commander": "^8.2.0",
"ci-info": "^3.7.1",
"commander": "^7.2.0",
"commondir": "^1.0.1",
"debug": "^4.3.1",
"dependency-tree": "^9.0.0",
Expand Down

0 comments on commit c35da47

Please sign in to comment.