Merge pull request #2767 from foghina/dont_swallow

[cli] don't swallow require(local_cli) errors
This commit is contained in:
Alexander Kotliarskyi 2015-09-17 11:34:37 +01:00
commit a88a134b13
1 changed files with 5 additions and 4 deletions

View File

@ -16,16 +16,17 @@ var CLI_MODULE_PATH = function() {
process.cwd(), process.cwd(),
'node_modules', 'node_modules',
'react-native', 'react-native',
'cli' 'cli.js'
); );
}; };
checkForVersionArgument(); checkForVersionArgument();
var cli; var cli;
try { var cliPath = CLI_MODULE_PATH();
cli = require(CLI_MODULE_PATH()); if (fs.existsSync(cliPath)) {
} catch(e) {} cli = require(cliPath);
}
if (cli) { if (cli) {
cli.run(); cli.run();