desc 'Update all svn- and git-based bundles in TextMate' task 'textmate:bundles:update' do BUNDLES = (Dir[(ENV["HOME"] + "/Library/Application Support/TextMate/Bundles/*")] + Dir[(ENV["HOME"] + "/Library/Application Support/TextMate/Pristine Copy/Bundles/*")]) for subdir in BUNDLES do if File.exist?((subdir + "/.git/config")) then sh("cd #{subdir.gsub(" ", "\\ ")} && git pull") elsif File.exist?((subdir + "/.svn/entries")) then sh("cd #{subdir.gsub(" ", "\\ ")} && svn up") end end end