From 5b08d7d917d634005c5e25660a42286eaebbd20c Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 3 Jul 2021 00:25:08 +0100 Subject: [PATCH] fix(nightly): ensure only relevant git tags are considered Previously non-matching tags were not filtered out from the list of valid versions. It wasn't an issue though cause all current releases do match the pattern we were looking for. But that will not be the case for much longer when stable releases are added into the mix. --- Casks/emacs-app-nightly.rb | 6 +++++- templates/emacs-app-nightly.rb.tpl | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Casks/emacs-app-nightly.rb b/Casks/emacs-app-nightly.rb index b2832891..221bf0c6 100644 --- a/Casks/emacs-app-nightly.rb +++ b/Casks/emacs-app-nightly.rb @@ -14,7 +14,10 @@ cask 'emacs-app-nightly' do url 'https://github.com/jimeh/emacs-builds.git' strategy :git do |tags| tags.map do |tag| - tag.gsub(/^Emacs\.(\d{4}-\d{2}-\d{2}\.\w+\.master)$/i, '\\1') + m = /^Emacs\.(\d{4}-\d{2}-\d{2}\.\w+\.master)$/.match(tag) + next unless m + + m[1] end.compact end end @@ -22,6 +25,7 @@ cask 'emacs-app-nightly' do conflicts_with( cask: %w[ emacs-app + emacs-app-good emacs emacs-nightly emacs-pretest diff --git a/templates/emacs-app-nightly.rb.tpl b/templates/emacs-app-nightly.rb.tpl index f59ffc2c..da26a78f 100644 --- a/templates/emacs-app-nightly.rb.tpl +++ b/templates/emacs-app-nightly.rb.tpl @@ -14,7 +14,10 @@ cask 'emacs-app-nightly' do url 'https://github.com/jimeh/emacs-builds.git' strategy :git do |tags| tags.map do |tag| - tag.gsub(/^Emacs\.(\d{4}-\d{2}-\d{2}\.\w+\.master)$/i, '\\1') + m = /^Emacs\.(\d{4}-\d{2}-\d{2}\.\w+\.master)$/.match(tag) + next unless m + + m[1] end.compact end end @@ -22,6 +25,7 @@ cask 'emacs-app-nightly' do conflicts_with( cask: %w[ emacs-app + emacs-app-good emacs emacs-nightly emacs-pretest