From 373c8777f6bad3a935089bd4c59bf2e15896de63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Oghin=C4=83?= Date: Wed, 16 Sep 2015 17:17:13 +0100 Subject: [PATCH] [cli] don't swallow require(local_cli) errors --- react-native-cli/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/react-native-cli/index.js b/react-native-cli/index.js index 73de9418f..1fe259e26 100755 --- a/react-native-cli/index.js +++ b/react-native-cli/index.js @@ -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();