frontend-tasks
Version:
Frontend Tasks is a wrapper around gulp for most of the normal use cases for simple and modern frontend development
20 lines (17 loc) • 471 B
JavaScript
import childProcess from 'child_process';
const spawn = childProcess.spawn;
import log from 'fancy-log';
const run = (options) => {
return (cb) => {
const cmd = spawn(options.cmd, options.args, { stdio: 'inherit' });
cmd.on('close', function (code) {
log(options.cmd + ' exited with code ' + code);
cb(code);
});
cmd.on('error', function (error) {
log.error(options.cmd + ' errored with msg: ' + error);
cb(error);
});
};
};
export default run;