Created
April 7, 2011 15:57
-
-
Save bengourley/908060 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Initialise vars | |
var gitOutput = "", | |
branch = null; | |
// Start reading stdin | |
process.stdin.resume(); | |
// Store read in chunks | |
process.stdin.on('data', function (chunk) { | |
gitOutput += chunk; | |
}); | |
// Finished readin in git output | |
process.stdin.on('end', function () { | |
branch = gitOutput.split(" ").pop().split("/").pop(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment