From 227ba42f819c8f3da5b36c170d6317684dd411f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Mon, 12 Oct 2015 10:01:23 -0700 Subject: [PATCH] Use the right gulp executable on Windows --- Gruntfile.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 8dee20f555..570e18f709 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -2,6 +2,12 @@ var assign = require('object-assign'); var path = require('path'); +var process = require('process'); + +var GULP_EXE = 'gulp'; +if (process.platform === 'win32') { + GULP_EXE += '.cmd'; +} module.exports = function(grunt) { @@ -25,10 +31,11 @@ module.exports = function(grunt) { grunt.config.set('compress', require('./grunt/config/compress')); function spawnGulp(args, opts, done) { + grunt.util.spawn({ // This could be more flexible (require.resolve & lookup bin in package) // but if it breaks we'll fix it then. - cmd: path.join('node_modules', '.bin', 'gulp'), + cmd: path.join('node_modules', '.bin', GULP_EXE), args: args, opts: assign({stdio: 'inherit'}, opts), }, function(err, result, code) {