mirror of https://github.com/status-im/metro.git
Introduce react native CLI
Reviewed By: @frantic Differential Revision: D2430522
This commit is contained in:
parent
9daabfa30c
commit
d5d0a0cfba
|
@ -20,7 +20,8 @@
|
||||||
|
|
||||||
var optimist = require('optimist');
|
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
|
// optimist default API requires you to write the command name three time
|
||||||
// This is a small wrapper to accept an object instead
|
// This is a small wrapper to accept an object instead
|
||||||
for (var i = 0; i < config.length; ++i) {
|
for (var i = 0; i < config.length; ++i) {
|
||||||
|
@ -38,7 +39,7 @@ function parseCommandLine(config) {
|
||||||
optimist.demand(config[i].command);
|
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'
|
// optimist doesn't have support for --dev=false, instead it returns 'false'
|
||||||
for (var i = 0; i < config.length; ++i) {
|
for (var i = 0; i < config.length; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue