Skip to content

Commit 373c877

Browse files
committed
[cli] don't swallow require(local_cli) errors
1 parent f775bb0 commit 373c877

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

react-native-cli/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ var CLI_MODULE_PATH = function() {
1616
process.cwd(),
1717
'node_modules',
1818
'react-native',
19-
'cli'
19+
'cli.js'
2020
);
2121
};
2222

2323
checkForVersionArgument();
2424

2525
var cli;
26-
try {
27-
cli = require(CLI_MODULE_PATH());
28-
} catch(e) {}
26+
var cliPath = CLI_MODULE_PATH();
27+
if (fs.existsSync(cliPath)) {
28+
cli = require(cliPath);
29+
}
2930

3031
if (cli) {
3132
cli.run();

0 commit comments

Comments
 (0)