From 4ce431b9cfdc6f32e0ad3edd9763932324c2cee3 Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Wed, 3 Aug 2016 00:53:05 -0700 Subject: [PATCH] Fixes command validity check for local-cli. Summary: Prior to the RNPM integration, command names would match the second argument passed to the react-native-cli. Now the command names contain some usage information (such as non-flag CLI arguments). This commit splits the name of the commands and checks that against the second command line argument. Closes https://github.com/facebook/react-native/pull/9171 Differential Revision: D3661799 fbshipit-source-id: dc2aa9cd9e69dde3c5b877aeb77a17c4f6427075 --- local-cli/cliEntry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local-cli/cliEntry.js b/local-cli/cliEntry.js index 303686ba1..8bd2f0b52 100644 --- a/local-cli/cliEntry.js +++ b/local-cli/cliEntry.js @@ -137,7 +137,7 @@ function run() { commander.parse(process.argv); - const isValidCommand = commands.find(cmd => cmd.name === process.argv[2]); + const isValidCommand = commands.find(cmd => cmd.name.split(' ')[0] === process.argv[2]); if (!isValidCommand) { printUnknownCommand(process.argv[2]);