Skip to content

Instantly share code, notes, and snippets.

@joshmanders joshmanders/server.js
Last active Jul 29, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.