Skip to content

Commit 990035d

Browse files
committedApr 27, 2024
Release 2.0.4
1 parent 5199771 commit 990035d

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed
 

‎lib/appium_thor/helpers.rb

+6-7
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ def _build_gem
88
end
99

1010
# Returns true if the tag exists on the master branch.
11-
def tag_exists(tag_name)
12-
cmd = %Q(git branch -a --contains "#{tag_name}")
13-
stdout, status = Open3.capture2(cmd)
14-
stdout.include? "* #{branch}"
15-
11+
def tag_exists? tag_name
12+
cmd = %Q(git rev-parse --verify refs/tags/"#{tag_name}")
13+
_, _, status = Open3.capture3(cmd)
14+
status.success?
1615
end
1716

1817
# Runs command. Raises an exception if the command doesn't execute successfully.
@@ -176,7 +175,7 @@ def _publish
176175

177176
# Commit then pull before pushing.
178177
tag_name = "v#{version}"
179-
raise 'Tag already exists!' if tag_exists tag_name
178+
raise 'Tag already exists!' if tag_exists? tag_name
180179

181180
# Commit then pull before pushing.
182181
sh "git commit --allow-empty -am 'Release #{version}'"
@@ -189,7 +188,7 @@ def _publish
189188
notes rescue notes_failed = true
190189
sh "git commit --allow-empty -am 'Update release notes'" unless notes_failed
191190
sh "git push origin #{branch}"
192-
# sh "git push origin #{tag_name}"
191+
sh "git push origin #{tag_name}"
193192
_build_gem
194193
puts "Please run 'gem push #{gem_name}-#{version}.gem'"
195194
end

‎lib/appium_thor/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Appium
22
module Thor
3-
VERSION = '2.0.3' unless defined? ::Appium::Thor::VERSION
3+
VERSION = '2.0.4' unless defined? ::Appium::Thor::VERSION
44
DATE = '2024-04-26' unless defined? ::Appium::Thor::DATE
55
end
66
end

0 commit comments

Comments
 (0)
Please sign in to comment.