Skip to content

Commit

Permalink
Added new info command (#3068)
Browse files Browse the repository at this point in the history
* Adds new info command

prints local environment information

* Add local parcel-bundler info
  • Loading branch information
jamesgeorge007 authored and DeMoorJasper committed May 23, 2019
1 parent fd7e36e commit 4c59571
Show file tree
Hide file tree
Showing 2 changed files with 18 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
17 changes: 17 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,22 @@ 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'],
npmPackages: ['parcel-bundler'],
npmGlobalPackages: ['parcel-bundler']
})
.then(console.log);
});

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

0 comments on commit 4c59571

Please sign in to comment.