Last active
July 29, 2016 13:35
-
-
Save joshmanders/a1f4d126af602daa8ea401bc453d740a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { spawn } = require('child_process') | |
const grunt = spawn('grunt', { | |
env: Object.assign({}, process.env, { PATH: `./node_modules/.bin:${process.env.PATH}` }), | |
stdio: 'inherit' | |
}) | |
grunt.on('close', (code) => { | |
console.log(`Grunt closed with error code ${code}`) | |
process.exit(code) | |
}) | |
grunt.on('error', (error) => { | |
console.log(`Grunt error: ${error}`) | |
process.exit(1) | |
}) | |
process.on('exit', () => { | |
grunt.kill() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment