Skip to content

Instantly share code, notes, and snippets.

@cv
Created November 24, 2008 02:46
Show Gist options
  • Save cv/28359 to your computer and use it in GitHub Desktop.
Save cv/28359 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
def update_git
puts `git fetch` if Dir['.git'].any?
end
def update_svn
puts `svn up` if Dir['.svn'].any?
end
def do_update
update_git
update_svn
# update_hg
end
Dir['*'].select {|f| File.directory? f }.each do |dir|
Dir.chdir(dir)
puts "Updating #{dir}..."
do_update
Dir.chdir('..')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment