From 990035d4a2c9dfab8757211b47d2cdf6bc5a1828 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Fri, 26 Apr 2024 23:07:22 -0700 Subject: [PATCH] Release 2.0.4 --- lib/appium_thor/helpers.rb | 13 ++++++------- lib/appium_thor/version.rb | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/appium_thor/helpers.rb b/lib/appium_thor/helpers.rb index b3824f5..807cdc7 100644 --- a/lib/appium_thor/helpers.rb +++ b/lib/appium_thor/helpers.rb @@ -8,11 +8,10 @@ def _build_gem end # Returns true if the tag exists on the master branch. - def tag_exists(tag_name) - cmd = %Q(git branch -a --contains "#{tag_name}") - stdout, status = Open3.capture2(cmd) - stdout.include? "* #{branch}" - + def tag_exists? tag_name + cmd = %Q(git rev-parse --verify refs/tags/"#{tag_name}") + _, _, status = Open3.capture3(cmd) + status.success? end # Runs command. Raises an exception if the command doesn't execute successfully. @@ -176,7 +175,7 @@ def _publish # Commit then pull before pushing. tag_name = "v#{version}" - raise 'Tag already exists!' if tag_exists tag_name + raise 'Tag already exists!' if tag_exists? tag_name # Commit then pull before pushing. sh "git commit --allow-empty -am 'Release #{version}'" @@ -189,7 +188,7 @@ def _publish notes rescue notes_failed = true sh "git commit --allow-empty -am 'Update release notes'" unless notes_failed sh "git push origin #{branch}" - # sh "git push origin #{tag_name}" + sh "git push origin #{tag_name}" _build_gem puts "Please run 'gem push #{gem_name}-#{version}.gem'" end diff --git a/lib/appium_thor/version.rb b/lib/appium_thor/version.rb index cb0b2a5..54c505c 100644 --- a/lib/appium_thor/version.rb +++ b/lib/appium_thor/version.rb @@ -1,6 +1,6 @@ module Appium module Thor - VERSION = '2.0.3' unless defined? ::Appium::Thor::VERSION + VERSION = '2.0.4' unless defined? ::Appium::Thor::VERSION DATE = '2024-04-26' unless defined? ::Appium::Thor::DATE end end \ No newline at end of file