Skip to content

Commit 4ce431b

Browse files
rozeleFacebook Github Bot 1
authored andcommitted
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 #9171 Differential Revision: D3661799 fbshipit-source-id: dc2aa9cd9e69dde3c5b877aeb77a17c4f6427075
1 parent de517a8 commit 4ce431b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

local-cli/cliEntry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function run() {
137137

138138
commander.parse(process.argv);
139139

140-
const isValidCommand = commands.find(cmd => cmd.name === process.argv[2]);
140+
const isValidCommand = commands.find(cmd => cmd.name.split(' ')[0] === process.argv[2]);
141141

142142
if (!isValidCommand) {
143143
printUnknownCommand(process.argv[2]);

0 commit comments

Comments
 (0)