Skip to content

Commit 049435b

Browse files
committed
Fix the release action
Make it compatible with release candidates and do not fail if a substitution does not update a file because we use this to make sure the version we release match what is found in the code.
1 parent 2200e17 commit 049435b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tasks/vox.rake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ namespace :vox do
1111
puts "Setting version to #{version}"
1212

1313
data = File.read('lib/facter/version.rb')
14-
new_data = data.sub(/VERSION = '\d+\.\d+\.\d+'/, "VERSION = '#{version}'")
15-
raise 'Failed to update version in lib/facter/version.rb' if data == new_data
14+
new_data = data.sub(/VERSION = '\d+\.\d+\.\d+(\.rc\d+)?'/, "VERSION = '#{version}'")
15+
warn 'Failed to update version in lib/facter/version.rb' if data == new_data
1616

1717
File.write('lib/facter/version.rb', new_data)
1818

1919
data = File.read('openfact.gemspec')
20-
new_data = data.sub(/(spec.version *=) '\d+\.\d+\.\d+'/, "\\1 '#{version}'")
21-
raise 'Failed to update version in openfact.gemspec' if data == new_data
20+
new_data = data.sub(/(spec.version *=) '\d+\.\d+\.\d+(\.rc\d+)?'/, "\\1 '#{version}'")
21+
warn 'Failed to update version in openfact.gemspec' if data == new_data
2222

2323
File.write('openfact.gemspec', new_data)
2424
end

0 commit comments

Comments
 (0)