Skip to content

Commit

Permalink
add envinfo package, —info flag (#3408)
Browse files Browse the repository at this point in the history
* add envinfo package, —info flag

* update envinfo to use new duplicates option
  • Loading branch information
tabrindle authored and gaearon committed Jan 9, 2018
1 parent ab507e6 commit b507a9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const tmp = require('tmp');
const unpack = require('tar-pack').unpack;
const url = require('url');
const hyperquest = require('hyperquest');
const envinfo = require('envinfo');

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

Expand All @@ -60,6 +61,7 @@ const program = new commander.Command(packageJson.name)
projectName = name;
})
.option('--verbose', 'print additional logs')
.option('--info', 'print environment debug info')
.option(
'--scripts-version <alternative-package>',
'use a non-standard version of react-scripts'
Expand Down Expand Up @@ -100,6 +102,14 @@ const program = new commander.Command(packageJson.name)
.parse(process.argv);

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.log(
` ${chalk.cyan(program.name())} ${chalk.green('<project-directory>')}`
Expand Down
1 change: 1 addition & 0 deletions packages/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"chalk": "^1.1.1",
"commander": "^2.9.0",
"cross-spawn": "^4.0.0",
"envinfo": "^3.8.0",
"fs-extra": "^1.0.0",
"hyperquest": "^2.1.2",
"semver": "^5.0.3",
Expand Down

0 comments on commit b507a9a

Please sign in to comment.