How to use the jake.createExec function in jake

To help you get started, we’ve selected a few jake examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jamesshore / quixote / build / util / sh.js View on Github external
var run = exports.run = function(oneCommand, successCallback, failureCallback) {
	var stdout = "";
	var child = jake.createExec(oneCommand);
	child.on("stdout", function(data) {
		process.stdout.write(data);
		stdout += data;
	});
	child.on("stderr", function(data) {
		process.stderr.write(data);
	});
	child.on("cmdEnd", function() {
		successCallback(stdout);
	});
	child.on("error", function() {
		failureCallback(stdout);
	});

	console.log("> " + oneCommand);
	child.run();
github jamesshore / automatopia / build / util / sh.js View on Github external
var run = exports.run = function(oneCommand, successCallback, failureCallback) {
		var stdout = "";
		var child = jake.createExec(oneCommand);
		child.on("stdout", function(data) {
			process.stdout.write(data);
			stdout += data;
		});
		child.on("stderr", function(data) {
			process.stderr.write(data);
		});
		child.on("cmdEnd", function() {
			successCallback(stdout);
		});
		child.on("error", function() {
			failureCallback(stdout);
		});

		console.log("> " + oneCommand);
		child.run();
github jamesshore / lets_code_javascript / build / util / sh.js View on Github external
var run = exports.run = function(oneCommand, successCallback, failureCallback, options) {
		options = options || {};
		var suppressOutput = (options.suppressOutput === true);

		var stdout = "";
		var child = jake.createExec(oneCommand);
		child.on("stdout", function(data) {
			if (!suppressOutput) process.stdout.write(data);
			stdout += data;
		});
		child.on("stderr", function(data) {
			process.stderr.write(data);
		});
		child.on("cmdEnd", function() {
			successCallback(stdout);
		});
		child.on("error", function() {
			failureCallback(stdout);
		});

		if (!suppressOutput) console.log("> " + oneCommand);
		child.run();