lib/dev_git.rb in dev-2.0.61 vs lib/dev_git.rb in dev-2.0.62
- old
+ new
@@ -37,16 +37,33 @@
def self.init directory=''
directory=Dir.pwd if directory.length==0
FileUtils.mkpath directory if !File.exists?(directory)
if(!File.exists?("#{directory}/.git"))
Dir.chdir(directory) do
- `git init`
- File.open('.gitignore','w'){|f|
- f.puts '### Mac ###'
- f.puts '*.DS_Store'
- }
- `git add .gitignore`
- `git commit -m'added .gitignore'`
+ `git init --bare`
+ #File.open('.gitignore','w'){|f|
+ # f.puts '### Mac ###'
+ # f.puts '*.DS_Store'
+ #}
+ #{}`git add .gitignore`
+ #{}`git commit -m'added .gitignore'`
+ end
+ end
+ end
+
+ def self.tag directory,version
+ directory=Dir.pwd if directory.length == 0
+ Dir.chdir(directory) do
+ `git pull`
+ tags=`git tag`
+ if(!tags.include?(version))
+ puts 'tagging branch'
+ puts `git tag version -m'#{version}'`
+ puts 'committing'
+ puts `git commit -m'#{version}'`
+ puts 'pushing'
+ puts `git push --tags`
+ puts `git push`
end
end
end
end