Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "pathname"
- GIT_REPOS = Dir["**/.git/.."].map { |path| path = Pathname.new(path).realpath }
- desc "Update all repositories"
- task :update do
- GIT_REPOS.each do |repo|
- command "git pull origin master", repo
- end
- end
- def command(cmd, dir = ".")
- Dir.chdir(dir) do
- return `#{cmd}`.chomp
- end
- end
Add Comment
Please, Sign In to add comment