Skip to content

Instantly share code, notes, and snippets.

@amcdnl
Created September 18, 2012 14:48
Show Gist options
  • Save amcdnl/3743530 to your computer and use it in GitHub Desktop.
Save amcdnl/3743530 to your computer and use it in GitHub Desktop.
Steal build via GruntJS

Steal build using GruntJS ( https://github.com/cowboy/grunt ).

Arguments: dir example: "todo/scripts/build.js"

grunt.registerHelper('steal', function (dir) {
	var done = this.async(),
		os = require('os');

	grunt.utils.spawn({    cmd: os.platform() == "win32" ? "js.bat" : "./js",
		    args: [ dir ]  
	}, function (err, result, code) {
		if (err) {
			grunt.log.error(err);
			return done(false);
		}

		done();
	});

	grunt.log.write("Steal building...");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment