Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions Casks/wezterm-nightly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@

# Unclear what the minimal OS version is
# depends_on macos: ">= :sierra"

livecheck do
url "https://github.com/wez/wezterm/releases/download/nightly/WezTerm-macos-nightly.zip"
strategy :header_match do |headers|
# matches last-modified header syntax
regex = /(\w{3}, )?(\d{1,2}) (\w{3}) (\d{4}) (\d{2}):(\d{2}):(\d{2}) GMT/
match = headers["last-modified"].match(regex)
if match.nil?
match = headers["x-ms-creation-time"].match(regex)
end

year = match[4]
month_idx = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"].index {|month| month == match[3].downcase}
month = (month_idx ? month_idx + 1 : 0).to_s.rjust(2,"0")
day = match[2].rjust(2, '0')
hour = match[5].rjust(2, '0')
minute = match[6].rjust(2, '0')
second = match[7].rjust(2, '0')
"#{year}#{month}#{day}#{hour}#{minute}#{second}"
end
end

app "WezTerm.app"
[
Expand Down Expand Up @@ -42,12 +63,6 @@ def caveats; <<~EOS
/opt/homebrew/bin/ for M1 Mac.

Removal of them is ensured by 'brew uninstall --cask #{token}'.

Since there's no version info included in the download URL of the nightly
build, NO update will be notified for 'wezterm-nightly' by Homebrew. (Not a
problem for non-nightly, regular released 'wezterm'.) To get the nightly
update, just run
'brew upgrade --cask wezterm-nightly --no-quarantine --greedy-latest'.
EOS
end
end