var fs = require("fs");
var path = require("path");
var child_process = require("child_process");

function invokeGrunt(callback) {
	if (fs.existsSync("Gruntfile.js") && !fs.existsSync("lib/appbuilder-cli.js")) {
		var grunt = require("grunt");
		grunt.cli.options.color = false;
		grunt.cli(null, callback);
	} else {
		process.nextTick(callback);
	}
}

invokeGrunt(function() {
	var child = child_process.exec("node bin/appbuilder.js dev-prepackage", function (error) {
		if (error) {
			console.error("Failed to complete all pre-publishing steps.");
			throw error;
		}
	});

	child.stdout.pipe(process.stdout);
});

@@ -134,41 +134,8 @@
 if (
-fs.existsSync(%22Gruntfile.js%22) && 
 !fs.
@@ -173,16 +173,16 @@
 js%22)) %7B%0A
+
 %09%09var gr
@@ -447,16 +447,345 @@
 rror) %7B%0A
+%09%09%09// don't rethrow if this step fails as part running 'npm install' in a Jenkins job,%0A%0A%09%09%09var doThrow = true;%0A%09%09%09if (process.env%5B%22JOB_NAME%22%5D) %7B%0A%09%09%09%09var argv = JSON.parse(process.env%5B%22npm_config_argv%22%5D);%0A%09%09%09%09if (argv.cooked%5B0%5D && argv.cooked%5B0%5D.toLowerCase() === %22install%22) %7B%0A%09%09%09%09%09doThrow = false;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%0A%09%09%09if (doThrow) %7B%0A%09
 %09%09%09conso
@@ -845,16 +845,17 @@
 .%22);%0A%09%09%09
+%09
 throw er
@@ -859,16 +859,21 @@
  error;%0A
+%09%09%09%7D%0A
 %09%09%7D%0A%09%7D);

fix error in jenkins build