Last active
August 29, 2015 13:58
-
-
Save dtan4/10111159 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
#!/usr/bin/env ruby | |
CHECK_DIRS = %w(dotfiles dot.emacs.d dot.zsh) | |
COMMANDS = { | |
push: "git push -u origin master", | |
pull: "git pull --stat --rebase origin master", | |
status: "git status -s" | |
} | |
type = ARGV.shift | |
if type.nil? || !COMMANDS.keys.include?(type.to_sym) | |
$stderr.puts "usage: git_check.rb [#{COMMANDS.keys.join("|")}]" | |
exit 1 | |
end | |
CHECK_DIRS.each do |dir| | |
puts "=== #{dir} ".ljust(40, "=") | |
`cd #{dir} && #{COMMANDS[type.to_sym]}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment