Created
August 6, 2014 14:17
-
-
Save joshtombs/ac0e5544796b331aea0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = -> | |
convertToExecOptions: (objArry, cb) -> | |
execOptions = | |
_.map objArry, (val) -> | |
k = _.keys(val)[0] | |
"#{k}=#{val[k]}" | |
cb(execOptions); | |
generateOptions: (minimist, config, cb) -> | |
options = | |
_(CONFIG_NAMES) | |
.map((name) -> | |
obj = {} | |
if (minimist[name]?) | |
obj[name] = minimist[name] | |
else if configFile[name]? | |
obj[name] = config[name] | |
if obj[name]? then obj else null | |
) | |
.compact() | |
.value() | |
console.log options | |
convertToExecOptions(options, cb) | |
## Trying to do this... | |
configBuilder.generateOptions(args, obj, startTesting) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment