Skip to content

Instantly share code, notes, and snippets.

@joshtombs
Created August 6, 2014 14:17
Show Gist options
  • Save joshtombs/ac0e5544796b331aea0a to your computer and use it in GitHub Desktop.
Save joshtombs/ac0e5544796b331aea0a to your computer and use it in GitHub Desktop.
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