mirror of https://github.com/status-im/metro.git
[ReactNative] Cleanup _build_bundle script
This commit is contained in:
parent
05b6cdf97a
commit
74e7e70e76
|
@ -24,12 +24,21 @@ function parseCommandLine(config) {
|
|||
// 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) {
|
||||
if (config[i].type === 'string') {
|
||||
optimist.string(config[i].command);
|
||||
} else {
|
||||
optimist.boolean(config[i].command);
|
||||
}
|
||||
|
||||
optimist
|
||||
.boolean(config[i].command)
|
||||
.default(config[i].command, config[i].default)
|
||||
.describe(config[i].command, config[i].description);
|
||||
|
||||
if (config[i].required) {
|
||||
optimist.demand(config[i].command);
|
||||
}
|
||||
}
|
||||
var argv = optimist.argv;
|
||||
var argv = optimist.parse(process.argv);
|
||||
|
||||
// optimist doesn't have support for --dev=false, instead it returns 'false'
|
||||
for (var i = 0; i < config.length; ++i) {
|
||||
|
|
Loading…
Reference in New Issue