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
This commit is contained in:
parent
de517a84e8
commit
4ce431b9cf
|
@ -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]);
|
||||
|
|
Loading…
Reference in New Issue