Skip to content

Commit 1cda112

Browse files
mikesherovtimmywil
authored andcommitted
Remove the Makefile and replace the submodule update with a grunt task. Thanks to @ryanneufeld. Closes jquerygh-953.
1 parent 077989e commit 1cda112

File tree

2 files changed

+19
-34
lines changed

2 files changed

+19
-34
lines changed

Makefile

Lines changed: 0 additions & 25 deletions
This file was deleted.

grunt.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
/*jshint node: true */
99
/*global config:true, task:true, process:true*/
10+
11+
var child_process = require("child_process");
12+
1013
module.exports = function( grunt ) {
1114

1215
// readOptionalJSON
@@ -379,22 +382,29 @@ module.exports = function( grunt ) {
379382
});
380383

381384
grunt.registerTask( "submodules", function() {
382-
var done = this.async();
385+
var done = this.async(),
386+
// change pointers for submodules and update them to what is specified in jQuery
387+
// --merge doesn't work when doing an initial clone, thus test if we have non-existing
388+
// submodules, then do an real update
389+
cmd = "if [ -d .git ]; then \n" +
390+
"if git submodule status | grep -q -E '^-'; then \n" +
391+
"git submodule update --init --recursive; \n" +
392+
"else \n" +
393+
"git submodule update --init --recursive --merge; \n" +
394+
"fi; \n" +
395+
"fi;";
383396

384397
grunt.verbose.write( "Updating submodules..." );
385398

386-
// TODO: migrate remaining `make` to grunt tasks
387-
//
388-
grunt.utils.spawn({
389-
cmd: "make"
390-
}, function( err, result ) {
391-
if ( err ) {
399+
child_process.exec( cmd, function( err, stdout, stderr ) {
400+
if ( stderr ) {
401+
console.log(stderr);
392402
grunt.verbose.error();
393-
done( err );
403+
done( stderr );
394404
return;
395405
}
396406

397-
grunt.log.writeln( result );
407+
grunt.log.writeln( stdout );
398408

399409
done();
400410
});

0 commit comments

Comments
 (0)