Commit b507a9ae authored by Trevor Brindle's avatar Trevor Brindle Committed by Dan Abramov
Browse files

add envinfo package, —info flag (#3408)

* add envinfo package, —info flag

* update envinfo to use new duplicates option
parent ab507e62
3 merge requests!12191Lim.Pisey.168:/Identified - We are currently investigating reports of missing build logs. The issue has been identified and a resolution is in progress. We will provide a further update when available.Mar 21, 09:02 UTC,!12853brikk,!5717Automatically extract project file structure from build bundle file
Showing with 11 additions and 0 deletions
+11 -0
...@@ -47,6 +47,7 @@ const tmp = require('tmp'); ...@@ -47,6 +47,7 @@ const tmp = require('tmp');
const unpack = require('tar-pack').unpack; const unpack = require('tar-pack').unpack;
const url = require('url'); const url = require('url');
const hyperquest = require('hyperquest'); const hyperquest = require('hyperquest');
const envinfo = require('envinfo');
const packageJson = require('./package.json'); const packageJson = require('./package.json');
...@@ -60,6 +61,7 @@ const program = new commander.Command(packageJson.name) ...@@ -60,6 +61,7 @@ const program = new commander.Command(packageJson.name)
projectName = name; projectName = name;
}) })
.option('--verbose', 'print additional logs') .option('--verbose', 'print additional logs')
.option('--info', 'print environment debug info')
.option( .option(
'--scripts-version <alternative-package>', '--scripts-version <alternative-package>',
'use a non-standard version of react-scripts' 'use a non-standard version of react-scripts'
...@@ -100,6 +102,14 @@ const program = new commander.Command(packageJson.name) ...@@ -100,6 +102,14 @@ const program = new commander.Command(packageJson.name)
.parse(process.argv); .parse(process.argv);
if (typeof projectName === 'undefined') { if (typeof projectName === 'undefined') {
if (program.info) {
envinfo.print({
packages: ['react', 'react-dom', 'react-scripts'],
noNativeIDE: true,
duplicates: true,
});
process.exit(0);
}
console.error('Please specify the project directory:'); console.error('Please specify the project directory:');
console.log( console.log(
` ${chalk.cyan(program.name())} ${chalk.green('<project-directory>')}` ` ${chalk.cyan(program.name())} ${chalk.green('<project-directory>')}`
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
"chalk": "^1.1.1", "chalk": "^1.1.1",
"commander": "^2.9.0", "commander": "^2.9.0",
"cross-spawn": "^4.0.0", "cross-spawn": "^4.0.0",
"envinfo": "^3.8.0",
"fs-extra": "^1.0.0", "fs-extra": "^1.0.0",
"hyperquest": "^2.1.2", "hyperquest": "^2.1.2",
"semver": "^5.0.3", "semver": "^5.0.3",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment