Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new info command #3068

Merged
merged 2 commits into from May 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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