mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 12:25:59 +08:00
Introduce react native CLI
Reviewed By: @frantic Differential Revision: D2430522
This commit is contained in:
committed by
facebook-github-bot-4
parent
71628638f6
commit
833ca598bc
@@ -20,7 +20,8 @@
|
||||
|
||||
var optimist = require('optimist');
|
||||
|
||||
function parseCommandLine(config) {
|
||||
function parseCommandLine(config, args) {
|
||||
args = args || process.argv;
|
||||
// optimist default API requires you to write the command name three time
|
||||
// This is a small wrapper to accept an object instead
|
||||
for (var i = 0; i < config.length; ++i) {
|
||||
@@ -38,7 +39,7 @@ function parseCommandLine(config) {
|
||||
optimist.demand(config[i].command);
|
||||
}
|
||||
}
|
||||
var argv = optimist.parse(process.argv);
|
||||
var argv = optimist.parse(args);
|
||||
|
||||
// optimist doesn't have support for --dev=false, instead it returns 'false'
|
||||
for (var i = 0; i < config.length; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user