Created
September 23, 2016 09:32
-
-
Save iissnan/32f1fd64e088de5c1dcaf2f5c468cabf to your computer and use it in GitHub Desktop.
DPW Grunt Processor
This file contains 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 path = require('path'); | |
const os = require('os'); | |
const cp = require('child_process'); | |
const spawn = require('cross-spawn'); | |
const Promise = require('bluebird'); | |
const buildDir = path.resolve(__dirname, '../../build/script'); | |
module.exports = { | |
run: function () { | |
const grunt = spawn('grunt', ['developer:dev'], { | |
cwd: buildDir, | |
detached: true | |
}); | |
grunt.stdout.on('data', function (data) { | |
console.log(data); | |
}); | |
grunt.stderr.on('data', function (data) { | |
console.log(os.EOL + data); | |
console.error('SOMETHING OCCURRED DURING SASS-COMPILE'.red); | |
}); | |
grunt.on('error', err => { throw err; }); | |
grunt.on('exit', data => { | |
console.log(os.EOL + 'DONE: Processor'); | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment