We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3deaff0 + 98c116c commit 64631d8Copy full SHA for 64631d8
Rakefile
@@ -4,7 +4,10 @@ namespace :book do
4
5
`cp progit.asc progit.asc.bak`
6
begin
7
- version_string = ENV['TRAVIS_TAG'] || '0'
+ version_string = ENV['TRAVIS_TAG'] || `git describe --tags`.chomp
8
+ if version_string.empty?
9
+ version_string = '0'
10
+ end
11
text = File.read('progit.asc')
12
new_contents = text.gsub("$$VERSION$$", version_string).gsub("$$DATE$$", Time.now.strftime("%Y-%m-%d"))
13
File.open("progit.asc", "w") {|file| file.puts new_contents }
0 commit comments