Last active
August 29, 2015 14:05
-
-
Save bunnymatic/7a183c70a9a4c84a6815 to your computer and use it in GitHub Desktop.
git bumper playtime
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
source "https://rubygems.org" | |
gem 'git' |
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 | |
require 'git' | |
tag = "git-bumper-was-here-#{Time.now.to_i}" | |
dirs = begin | |
if ARGV.length > 0 | |
ARGV | |
else | |
Dir.glob(File.join("/projects", "*")) | |
end | |
end | |
dirs.each do |dir| | |
begin | |
g = Git.open(dir) | |
puts "DIR", dir | |
g.add_tag tag, "HEAD" | |
g.push 'origin', tag | |
rescue ArgumentError => ex | |
# not a git dir | |
puts "Not a valid git dir", ex | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment