Created
January 29, 2012 19:31
-
-
Save mscoutermarsh/1700277 to your computer and use it in GitHub Desktop.
perl script... automate commit and push to github/heroku
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
#perl script to automate git push | |
`git add . >/dev/null`; | |
print "add\n"; | |
print "Commit Message:"; | |
$cmsg = <>; | |
`git commit -m '$cmsg' >/dev/null`; | |
print "\npushing to github...\n"; | |
print "#################################\n"; | |
`git push > /dev/null`; | |
print "#################################\n"; | |
my $heroku; | |
$valid = 0; | |
while (!$valid) { | |
print "\nPush to Heroku(Y/n)? "; | |
$heroku = <STDIN>; | |
if ($heroku =~ /^Y|^n+/){ | |
$valid = 1; | |
} | |
} | |
if ($heroku =~ /^Y+/ ) { | |
#also push to heroku | |
print "\npushing to heroku...\n"; | |
print "#################################\n"; | |
`git push heroku master >/dev/null`; | |
print "#################################\n"; | |
} | |
print "\ndone\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment