aboutsummaryrefslogtreecommitdiffstats
path: root/grunt.js
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-10-15 09:38:27 -0400
committerTimmy Willison <timmywillisn@gmail.com>2012-10-15 09:38:27 -0400
commit1cda1120e3fee605e456a8258bd0b26ca1d00c8e (patch)
tree97ba4afce96054b7f1b5420a50059d4670c4a71f /grunt.js
parent077989e8c0c56ed059bffeb504cfd201e6c5c9cf (diff)
downloadjquery-1cda1120e3fee605e456a8258bd0b26ca1d00c8e.tar.gz
jquery-1cda1120e3fee605e456a8258bd0b26ca1d00c8e.zip
Remove the Makefile and replace the submodule update with a grunt task. Thanks to @ryanneufeld. Closes gh-953.
Diffstat (limited to 'grunt.js')
-rw-r--r--grunt.js28
1 files changed, 19 insertions, 9 deletions
diff --git a/grunt.js b/grunt.js
index 7ccf49f95..d20df2ad2 100644
--- a/grunt.js
+++ b/grunt.js
@@ -7,6 +7,9 @@
/*jshint node: true */
/*global config:true, task:true, process:true*/
+
+var child_process = require("child_process");
+
module.exports = function( grunt ) {
// readOptionalJSON
@@ -379,22 +382,29 @@ module.exports = function( grunt ) {
});
grunt.registerTask( "submodules", function() {
- var done = this.async();
+ var done = this.async(),
+ // change pointers for submodules and update them to what is specified in jQuery
+ // --merge doesn't work when doing an initial clone, thus test if we have non-existing
+ // submodules, then do an real update
+ cmd = "if [ -d .git ]; then \n" +
+ "if git submodule status | grep -q -E '^-'; then \n" +
+ "git submodule update --init --recursive; \n" +
+ "else \n" +
+ "git submodule update --init --recursive --merge; \n" +
+ "fi; \n" +
+ "fi;";
grunt.verbose.write( "Updating submodules..." );
- // TODO: migrate remaining `make` to grunt tasks
- //
- grunt.utils.spawn({
- cmd: "make"
- }, function( err, result ) {
- if ( err ) {
+ child_process.exec( cmd, function( err, stdout, stderr ) {
+ if ( stderr ) {
+ console.log(stderr);
grunt.verbose.error();
- done( err );
+ done( stderr );
return;
}
- grunt.log.writeln( result );
+ grunt.log.writeln( stdout );
done();
});