Skip to content

Instantly share code, notes, and snippets.

@paulbaumgart
Created April 26, 2010 08:30
Show Gist options
  • Save paulbaumgart/379102 to your computer and use it in GitHub Desktop.
Save paulbaumgart/379102 to your computer and use it in GitHub Desktop.
exports.command = function (command) {
var process = exports.popen(command);
var status = process.wait();
if (status !== 0)
throw new Error("(" + status + ") " + process.stderr.read());
return process.stdout.read();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment