Skip to content

Commit

Permalink
CLI: Show npm / yarn output during 'react-native-init' when installin…
Browse files Browse the repository at this point in the history
…g React and Jest

Summary:
I missed this while doing the Yeoman wipeout.

Currently we just print:

    Installing React...
    Installing Jest...

This diff makes it print the output of those commands.

**Test Plan**

Published react-native to Sinopia, ran `react-native init MyApp`, saw the output:

    Installing Jest...
    ⸨░░░░░░░░░░░░░░░⸩ ⠸ normalizeTree: ...

Reviewed By: bestander

Differential Revision: D4286640

fbshipit-source-id: e554f03a4729c2de85eba527f10f4b727de722e4
  • Loading branch information
Martin Konicek committed Dec 12, 2016
1 parent 8f0aed6 commit 63804db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions local-cli/init/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,21 @@ function generateProject(destinationRoot, newProjectName, options) {

if (yarnVersion) {
console.log('Adding React...');
execSync(`yarn add react@${reactVersion}`);
execSync(`yarn add react@${reactVersion}`, {stdio: 'inherit'});
} else {
console.log('Installing React...');
execSync(`npm install react@${reactVersion} --save --save-exact`);
execSync(`npm install react@${reactVersion} --save --save-exact`, {stdio: 'inherit'});
}
if (!options['skip-jest']) {
const jestDeps = (
`jest babel-jest babel-preset-react-native react-test-renderer@${reactVersion}`
);
if (yarnVersion) {
console.log('Adding Jest...');
execSync(`yarn add ${jestDeps} --dev --exact`);
execSync(`yarn add ${jestDeps} --dev --exact`, {stdio: 'inherit'});
} else {
console.log('Installing Jest...');
execSync(`npm install ${jestDeps} --save-dev --save-exact`);
execSync(`npm install ${jestDeps} --save-dev --save-exact`, {stdio: 'inherit'});
}
addJestToPackageJson(destinationRoot);
}
Expand Down

0 comments on commit 63804db

Please sign in to comment.