Skip to content

Loading…

Use grunt option with grunt.util.spawn #1255

Closed
wants to merge 1 commit into from

2 participants

@shama

Detecting the grunt binary can be tricky as grunt can exists in many different ways. We found using process.argv[0] and process.argv[1] to be the most reliable so in Grunt v0.4 we added a grunt: true option to grunt.util.spawn.

This change will ensure spawning grunt will work with more environments and setups. Reference this stackoverflow question.

Thanks!

@dmethvin
jQuery Foundation member

Thanks @shama! If you want to sign the CLA I can add you to the authors file.

Note to self, https://github.com/jquery/jquery/blob/master/build/release.js#L27 needs fixin too but I'll get it separately since that file is in the middle of some refuctoring.

@shama

Signed, thanks!

@dmethvin dmethvin added a commit that referenced this pull request
@shama shama Use grunt option with grunt.util.spawn, close gh-1255.
(cherry picked from commit b5580a9)
a6d35a3
@dmethvin dmethvin closed this in b5580a9
@shama shama deleted the shama:spawn-grunt branch
@mescoda mescoda pushed a commit to mescoda/jquery that referenced this pull request
@shama shama Use grunt option with grunt.util.spawn, close gh-1255.
(cherry picked from commit b5580a9)
c963931
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 24, 2013
  1. @shama
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1 Gruntfile.js
View
2 Gruntfile.js
@@ -260,7 +260,7 @@ module.exports = function( grunt ) {
grunt.log.writeln( "Creating custom build...\n" );
grunt.util.spawn({
- cmd: process.platform === "win32" ? "grunt.cmd" : "grunt",
+ grunt: true,
args: [ "build:*:*:" + modules, "pre-uglify", "uglify", "dist" ]
}, function( err, result ) {
if ( err ) {
Something went wrong with that request. Please try again.