Created
December 19, 2012 19:46
-
-
Save dmethvin/4339862 to your computer and use it in GitHub Desktop.
Test case for node.js exec, particularly for Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var child = require("child_process"); | |
child.execFile("git", [ "status" ], function( error, stdout ) { | |
console.log("==== result from child.execFile() ===="); | |
if ( error ) { | |
console.error("ERROR: " + error); | |
} | |
console.log(stdout); | |
}); | |
child.exec("git status", function( error, stdout ) { | |
console.log("==== result from child.exec() ===="); | |
if ( error ) { | |
console.error("ERROR: " + error); | |
} | |
console.log(stdout); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment