Commit d01253e2 authored by jaubourg's avatar jaubourg

Fixes update submodule task for windows (uses an npm based task)

parent cb67571d
...@@ -123,7 +123,7 @@ module.exports = function( grunt ) { ...@@ -123,7 +123,7 @@ module.exports = function( grunt ) {
}); });
// Default grunt. // Default grunt.
grunt.registerTask( "default", "submodules selector build:*:* lint min dist:* compare_size" ); grunt.registerTask( "default", "update_submodules selector build:*:* lint min dist:* compare_size" );
// Short list as a high frequency watch task // Short list as a high frequency watch task
grunt.registerTask( "dev", "selector build:*:* lint" ); grunt.registerTask( "dev", "selector build:*:* lint" );
...@@ -131,6 +131,7 @@ module.exports = function( grunt ) { ...@@ -131,6 +131,7 @@ module.exports = function( grunt ) {
// Load grunt tasks from NPM packages // Load grunt tasks from NPM packages
grunt.loadNpmTasks( "grunt-compare-size" ); grunt.loadNpmTasks( "grunt-compare-size" );
grunt.loadNpmTasks( "grunt-git-authors" ); grunt.loadNpmTasks( "grunt-git-authors" );
grunt.loadNpmTasks( "grunt-update-submodules" );
grunt.registerTask( "testswarm", function( commit, configFile ) { grunt.registerTask( "testswarm", function( commit, configFile ) {
var testswarm = require( "testswarm" ), var testswarm = require( "testswarm" ),
...@@ -381,35 +382,6 @@ module.exports = function( grunt ) { ...@@ -381,35 +382,6 @@ module.exports = function( grunt ) {
log.writeln( "File '" + name + "' created." ); log.writeln( "File '" + name + "' created." );
}); });
grunt.registerTask( "submodules", function() {
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..." );
child_process.exec( cmd, function( err, stdout, stderr ) {
if ( stderr ) {
console.log(stderr);
grunt.verbose.error();
done( stderr );
return;
}
grunt.log.writeln( stdout );
done();
});
});
// Allow custom dist file locations // Allow custom dist file locations
grunt.registerTask( "dist", function() { grunt.registerTask( "dist", function() {
var flags, paths, stored; var flags, paths, stored;
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"devDependencies": { "devDependencies": {
"grunt-compare-size": ">=0.1.0", "grunt-compare-size": ">=0.1.0",
"grunt-git-authors": ">=1.0.0", "grunt-git-authors": ">=1.0.0",
"grunt-update-submodules": ">=0.1.0",
"grunt": "~0.3.9", "grunt": "~0.3.9",
"testswarm": "0.2.2" "testswarm": "0.2.2"
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment