Fix issue where beautifier.run would not resolve promisified args

This commit is contained in:
Glavin Wiechert 2016-06-24 15:31:11 -03:00
parent 95e3e4410c
commit f6f85e4a2f
1 changed files with 7 additions and 6 deletions

View File

@ -257,15 +257,12 @@ module.exports = class Beautifier
.then(([exeName, args]) =>
@debug('exeName, args:', exeName, args)
# Remove undefined/null values
args = _.without(args, undefined)
args = _.without(args, null)
# Get PATH and other environment variables
Promise.all([exeName, @getShellEnvironment(), @which(exeName)])
Promise.all([exeName, args, @getShellEnvironment(), @which(exeName)])
)
.then(([exeName, env, exePath]) =>
.then(([exeName, args, env, exePath]) =>
@debug('exePath, env:', exePath, env)
@debug('args', args)
exe = exePath ? exeName
options = {
@ -307,6 +304,10 @@ module.exports = class Beautifier
Spawn
###
spawn: (exe, args, options, onStdin) ->
# Remove undefined/null values
args = _.without(args, undefined)
args = _.without(args, null)
return new Promise((resolve, reject) =>
@debug('spawn', exe, args)