homebrew-cask/Casks/wezterm.rb

43 lines
1.3 KiB
Ruby

cask "wezterm" do
version "20221119-145034,49b9839f"
sha256 "6b7fd6abe5ccf129584bb2f0887a83c07c3ae4aba82fbb820a7d8e092a9835d4"
url "https://github.com/wez/wezterm/releases/download/#{version.csv.first}-#{version.csv.second}/WezTerm-macos-#{version.csv.first}-#{version.csv.second}.zip",
verified: "github.com/wez/wezterm/"
name "WezTerm"
desc "GPU-accelerated cross-platform terminal emulator and multiplexer"
homepage "https://wezfurlong.org/wezterm/"
livecheck do
url :url
regex(%r{href=["']?[^"' >]*?/tag/[^"' >]*?(\d+(?:[.-]\d+)+)-(\h+)["' >]}i)
strategy :github_latest do |page, regex|
page.scan(regex).map { |match| "#{match[0]},#{match[1]}" }
end
end
conflicts_with cask: "homebrew/cask-versions/wezterm-nightly"
app "WezTerm.app"
%w[
wezterm
wezterm-gui
wezterm-mux-server
strip-ansi-escapes
].each do |tool|
binary "#{appdir}/WezTerm.app/Contents/MacOS/#{tool}"
end
preflight do
# Move "WezTerm-macos-#{version}/WezTerm.app" out of the subfolder
staged_subfolder = staged_path.glob(["WezTerm-*", "wezterm-*"]).first
if staged_subfolder
FileUtils.mv(staged_subfolder/"WezTerm.app", staged_path)
FileUtils.rm_rf(staged_subfolder)
end
end
zap trash: "~/Library/Saved Application State/com.github.wez.wezterm.savedState"
end