Skip to content

Instantly share code, notes, and snippets.

@dtan4
Last active August 29, 2015 13:58
Show Gist options
  • Save dtan4/10111159 to your computer and use it in GitHub Desktop.
Save dtan4/10111159 to your computer and use it in GitHub Desktop.
#!/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