Created
May 11, 2016 20:45
-
-
Save gka/ff45c5148ad80b53d1d52641006b1194 to your computer and use it in GitHub Desktop.
git-go
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
#!/usr/bin/env node | |
var cmds = []; | |
if (process.argv.length < 3) { | |
console.log('You need to provide a commit message required!'); | |
process.exit(-1); | |
} | |
cmds.push('git add -A'); | |
cmds.push('git add -u'); | |
cmds.push('git commit -m "'+process.argv.slice(2).join(' ')+'"'); | |
cmds.push('git pull'); | |
cmds.push('git push'); | |
require('child_process').exec(cmds.join(' && '), function(err, stdout, stderr) { | |
if (err) console.error(err); | |
if (stdout) console.log(stdout); | |
if (stderr) console.error(stderr); | |
}); |
following @1wheel's advice, git-go is now a npm package that you can simply install using
npm install -g git-go
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
usage:
this is a node port of @jashkenas ruby git-go