Guest User

Untitled

a guest
May 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. require "pathname"
  2.  
  3. GIT_REPOS = Dir["**/.git/.."].map { |path| path = Pathname.new(path).realpath }
  4.  
  5. desc "Update all repositories"
  6. task :update do
  7. GIT_REPOS.each do |repo|
  8. command "git pull origin master", repo
  9. end
  10. end
  11.  
  12. def command(cmd, dir = ".")
  13. Dir.chdir(dir) do
  14. return `#{cmd}`.chomp
  15. end
  16. end
Add Comment
Please, Sign In to add comment