Skip to content

Commit 64631d8

Browse files
authored
Merge pull request #1067 from rahrah/patch-2
Get Version from git describe not travis envvar
2 parents 3deaff0 + 98c116c commit 64631d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Rakefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ namespace :book do
44

55
`cp progit.asc progit.asc.bak`
66
begin
7-
version_string = ENV['TRAVIS_TAG'] || '0'
7+
version_string = ENV['TRAVIS_TAG'] || `git describe --tags`.chomp
8+
if version_string.empty?
9+
version_string = '0'
10+
end
811
text = File.read('progit.asc')
912
new_contents = text.gsub("$$VERSION$$", version_string).gsub("$$DATE$$", Time.now.strftime("%Y-%m-%d"))
1013
File.open("progit.asc", "w") {|file| file.puts new_contents }

0 commit comments

Comments
 (0)