Skip to content

Commit 00ecb61

Browse files
tabrindlePavel Zhytko
authored and
Pavel Zhytko
committed
add envinfo package, —info flag (facebook#3408)
* add envinfo package, —info flag * update envinfo to use new duplicates option
1 parent 8800502 commit 00ecb61

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/create-react-app/createReactApp.js

+10
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const tmp = require('tmp');
4747
const unpack = require('tar-pack').unpack;
4848
const url = require('url');
4949
const hyperquest = require('hyperquest');
50+
const envinfo = require('envinfo');
5051

5152
const packageJson = require('./package.json');
5253

@@ -60,6 +61,7 @@ const program = new commander.Command(packageJson.name)
6061
projectName = name;
6162
})
6263
.option('--verbose', 'print additional logs')
64+
.option('--info', 'print environment debug info')
6365
.option(
6466
'--scripts-version <alternative-package>',
6567
'use a non-standard version of react-scripts'
@@ -100,6 +102,14 @@ const program = new commander.Command(packageJson.name)
100102
.parse(process.argv);
101103

102104
if (typeof projectName === 'undefined') {
105+
if (program.info) {
106+
envinfo.print({
107+
packages: ['react', 'react-dom', 'react-scripts'],
108+
noNativeIDE: true,
109+
duplicates: true,
110+
});
111+
process.exit(0);
112+
}
103113
console.error('Please specify the project directory:');
104114
console.log(
105115
` ${chalk.cyan(program.name())} ${chalk.green('<project-directory>')}`

packages/create-react-app/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"chalk": "^1.1.1",
2525
"commander": "^2.9.0",
2626
"cross-spawn": "^4.0.0",
27+
"envinfo": "^3.8.0",
2728
"fs-extra": "^1.0.0",
2829
"hyperquest": "^2.1.2",
2930
"semver": "^5.0.3",

0 commit comments

Comments
 (0)