Created
August 13, 2013 12:40
-
-
Save geoffgarside/6220710 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 | |
# | |
cmdargs = ARGV.map do |arg| | |
arg = arg.strip | |
if arg.index(" ") | |
"\"#{arg}\"" | |
else | |
arg | |
end | |
end | |
cmdargs = cmdargs.join(" ") | |
begin | |
Dir['*/.git'].each do |gitdir| | |
worktree = File.dirname(gitdir) | |
puts "==> In #{worktree} directory: git #{cmdargs}" | |
system "git --git-dir='./#{gitdir}' --work-tree='./#{worktree}' #{cmdargs}" | |
puts "" | |
end | |
rescue Interrupt | |
puts "" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment