Skip to content

Commit

Permalink
fix(run): support multiple commands
Browse files Browse the repository at this point in the history
  • Loading branch information
watilde committed Aug 3, 2017
1 parent c845e5a commit 0e5b51d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/run/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ module.exports = (_, pkg) => {
script === key ||
script === 'post' + key
}).map((script) => {
return scripts[script].split(' ')
return scripts[script]
})
var env = process.env
var newPath = npmPath.getSync({})
env[npmPath.PATH] = newPath

return Promise.resolve(cmds).then(each((item) => {
return Promise.resolve(cmds).then(each((cmd) => {
return new Promise((resolve, reject) => {
const cmd = item.shift()
const script = spawn(cmd, args.concat(item), {env: env})
const script = spawn(cmd, args, {shell: true, env: env})
script.stdout.on('data', (data) => {
process.stdout.write(data)
})
Expand Down

0 comments on commit 0e5b51d

Please sign in to comment.