mirror of
https://github.com/status-im/react-native.git
synced 2025-01-28 10:14:49 +00:00
[ReactNative] Cleanup _build_bundle script
This commit is contained in:
parent
d211359aeb
commit
1b2975803b
@ -24,12 +24,21 @@ function parseCommandLine(config) {
|
|||||||
// 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) {
|
||||||
|
if (config[i].type === 'string') {
|
||||||
|
optimist.string(config[i].command);
|
||||||
|
} else {
|
||||||
|
optimist.boolean(config[i].command);
|
||||||
|
}
|
||||||
|
|
||||||
optimist
|
optimist
|
||||||
.boolean(config[i].command)
|
|
||||||
.default(config[i].command, config[i].default)
|
.default(config[i].command, config[i].default)
|
||||||
.describe(config[i].command, config[i].description);
|
.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'
|
// 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…
x
Reference in New Issue
Block a user