Skip to content

Instantly share code, notes, and snippets.

@mscoutermarsh
Created January 29, 2012 19:31
Show Gist options
  • Save mscoutermarsh/1700277 to your computer and use it in GitHub Desktop.
Save mscoutermarsh/1700277 to your computer and use it in GitHub Desktop.
perl script... automate commit and push to github/heroku
#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