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(),
'node_modules',
'react-native',
'cli'
'cli.js'
);
};
checkForVersionArgument();
var cli;
try {
cli = require(CLI_MODULE_PATH());
} catch(e) {}
var cliPath = CLI_MODULE_PATH();
if (fs.existsSync(cliPath)) {
cli = require(cliPath);
}
if (cli) {
cli.run();