Warn about long run time of init.

Summary:
I, like many before me, had to Google why react-native init appeared to hang the first time I tried it.

It turns out it can just take a really long time, but does not give any warning of this fact.

This patch provides such a warning.
Closes https://github.com/facebook/react-native/pull/9406

Differential Revision: D3716357

Pulled By: bestander

fbshipit-source-id: 6a460c881a20b9edb1bd1c8c5df09e5a7e5020ed
This commit is contained in:
Edward Delaporte 2016-08-15 04:34:13 -07:00 committed by Facebook Github Bot 3
parent 5df9c67351
commit 1a683fa5e8
1 changed files with 2 additions and 1 deletions

View File

@ -102,6 +102,7 @@ if (cli) {
); );
process.exit(1); process.exit(1);
} else { } else {
if (!argv.verbose) console.log('This may take some time...');
init(commands[1], argv.verbose, argv.version); init(commands[1], argv.verbose, argv.version);
} }
break; break;
@ -263,7 +264,7 @@ function checkForVersionArgument() {
try { try {
console.log('react-native: ' + require(REACT_NATIVE_PACKAGE_JSON_PATH()).version); console.log('react-native: ' + require(REACT_NATIVE_PACKAGE_JSON_PATH()).version);
} catch (e) { } catch (e) {
console.log('react-native: n/a - not inside a React Native project directory') console.log('react-native: n/a - not inside a React Native project directory');
} }
process.exit(); process.exit();
} }