Created
October 28, 2010 07:09
-
-
Save pablo-meier/650815 to your computer and use it in GitHub Desktop.
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/ruby | |
FILENAME = "this_many_pushes.txt" | |
PUSH_IT_DIR = "/Users/pmeier/Desktop/projects/push_it" | |
command = "git push " | |
ARGV.each { |x| command += x + " " } | |
puts command | |
success = system(command) | |
if not success then puts "Push failed!"; Process.exit end | |
num_pushes = File.read(FILENAME).strip.to_i | |
puts num_pushes.to_s | |
if num_pushes == 0 | |
puts "Push it!" | |
system("mpg123 #{PUSH_IT_DIR}/push_it.mp3 &") | |
system("echo '5' > #{FILENAME}") | |
else | |
system("echo '#{num_pushes - 1}' > #{FILENAME}") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment