Skip to content

Commit 26f4dbb

Browse files
author
Kevin Paulisse
committed
Prevent tagging and pushing when version number override is used
1 parent cc3100d commit 26f4dbb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

rake/gem.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@ def self.build(target = GEMFILE)
4343

4444
# Push the gem to rubygems
4545
def self.push
46+
raise 'Cannot push version that does not match .version file' unless version == OctocatalogDiff::Version::VERSION
4647
raise "The gem file doesn't exist: #{FINAL_GEMFILE}" unless File.file?(FINAL_GEMFILE)
4748
exec_command("gem push #{Shellwords.escape(FINAL_GEMFILE)}")
4849
end
4950

5051
# Tag the release on GitHub
5152
def self.tag
53+
raise 'Cannot tag version that does not match .version file' unless version == OctocatalogDiff::Version::VERSION
54+
5255
# Make sure we have not released this version before
5356
exec_command('git fetch -t origin')
5457
tags = exec_command('git tag -l').split(/\n/)

0 commit comments

Comments
 (0)