3 sha256 "c1a1ff2263b3ded7816c8d2e7309e77f3d0901d488c8559281cfd4d2bb7b891b"
5 url "https://github.com/kingToolbox/WindTerm/releases/download/#{version.csv.second || version.csv.first}/WindTerm_#{version.csv.first}_Mac_Portable_x86_64.dmg"
7 desc "SSH/SFTP/Shell/Telnet/Serial terminal"
8 homepage "https://github.com/kingToolbox/WindTerm"
10 # Upstream doesn't provide a macOS file with every release, so we have to
11 # check multiple GitHub releases instead of only the "latest" one. They also
12 # seem to regularly add patch versions to existing releases (e.g., adding
13 # 2.6.1 files to the 2.6.0 release), so we optionally append the tag version
14 # if it differs from the file version.
17 regex(/WindTerm[._-]v?(\d+(?:\.\d+)+)(?:[._-]Mac|.*\.dmg)/i)
18 strategy :github_releases do |json, regex|
20 next if release["draft"] || release["prerelease"]
22 tag_version = release["tag_name"][/^v?(\d+(?:\.\d+)+)$/i, 1]
23 next if tag_version.blank?
25 release["assets"]&.map do |asset|
26 match = asset["name"]&.match(regex)
29 (match[1] == tag_version) ? tag_version : "#{match[1]},#{tag_version}"
36 depends_on macos: ">= :high_sierra"
41 "~/Library/Preferences/KingToolbox.WindTerm.plist",
42 "~/Library/Saved Application State/KingToolbox.WindTerm.savedState",