From 58512d7f2fe740c0c5ef8900be0476f5ba55d6ac Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Tue, 2 Aug 2016 15:37:49 -0400 Subject: [PATCH] Fixes command validity check for local-cli. 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. --- 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 303686ba1c6618..8bd2f0b52ef15c 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]);