Skip to content

Commit

Permalink
Adds new info command
Browse files Browse the repository at this point in the history
prints local environment information
  • Loading branch information
jamesgeorge007 committed May 22, 2019
1 parent fd7e36e commit 3d11b57
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/parcel-bundler/package.json
Expand Up @@ -47,6 +47,7 @@
"deasync": "^0.1.14",
"dotenv": "^5.0.0",
"dotenv-expand": "^4.2.0",
"envinfo": "^7.3.1",
"fast-glob": "^2.2.2",
"filesize": "^3.6.0",
"get-port": "^3.2.0",
Expand Down
16 changes: 16 additions & 0 deletions packages/core/parcel-bundler/src/cli.js
@@ -1,5 +1,6 @@
require('v8-compile-cache');
const chalk = require('chalk');
const envinfo = require('envinfo');
const program = require('commander');
const version = require('../package.json').version;

Expand Down Expand Up @@ -164,6 +165,21 @@ program
.option('--cache-dir <path>', 'set the cache directory. defaults to ".cache"')
.action(bundle);

program
.command('info')
.description('Prints debugging information about the local environment')
.action(function() {
console.log(chalk.bold('\nEnvironment Info:'));
envinfo
.run({
System: ['OS', 'CPU'],
Binaries: ['Node', 'Yarn', 'npm'],
Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],
npmGlobalPackages: ['parcel-bundler']
})
.then(console.log);
});

program
.command('help [command]')
.description('display help information for a command')
Expand Down

0 comments on commit 3d11b57

Please sign in to comment.