2017-10-28 13:23:56 +02:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
|
|
const { fromEvent } = require('promise-toolbox')
|
|
|
|
|
const { spawn } = require('child_process')
|
|
|
|
|
|
|
|
|
|
const { getPackages } = require('./utils')
|
|
|
|
|
|
|
|
|
|
require('exec-promise')(([ command, ...args ]) =>
|
|
|
|
|
getPackages().forEach(({ dir, name }) => {
|
|
|
|
|
console.log('*', name)
|
|
|
|
|
return fromEvent(spawn(command, args, {
|
|
|
|
|
cwd: dir,
|
2017-12-12 12:06:32 +01:00
|
|
|
stdio: 'inherit',
|
2017-10-28 13:23:56 +02:00
|
|
|
}), 'exit').then(code => {
|
|
|
|
|
if (code !== 0) {
|
|
|
|
|
throw code
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
)
|