Skip to content
  • Sponsor facebook/create-react-app

  • Notifications You must be signed in to change notification settings
  • Fork 27k
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

add envinfo package, —info flag #3408

Merged
merged 2 commits into from
Jan 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
@@ -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');

@@ -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'
@@ -99,6 +101,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>')}`
1 change: 1 addition & 0 deletions packages/create-react-app/package.json
Original file line number Diff line number Diff line change
@@ -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",