Merge pull request #200213 from Homebrew/bump-tidelift-1.14.0
[Homebrew/homebrew-cask.git] / Casks / u / uniflash.rb
blob048af6d41b4bded23aec169d5c0fa384ff14907a
1 cask "uniflash" do
2   version "9.0.0.5086"
3   sha256 "2f64efd6e56f98e7471d67379b313250b6331f616e75affb7e1e8f9e7aec2cec"
5   url "https://dr-download.ti.com/software-development/software-programming-tool/MD-QeJBJLj8gq/#{version.major_minor_patch}/uniflash_sl.#{version}.dmg"
6   name "TI UniFlash"
7   desc "Flash tool for microcontrollers"
8   homepage "https://www.ti.com/tool/UNIFLASH"
10   livecheck do
11     url :homepage
12     regex(/href=.*?uniflash_sl\.(\d+(?:\.\d+)+)\.dmg/i)
13   end
15   installer script: {
16     executable: "uniflash_sl.#{version}.app/Contents/MacOS/installbuilder.sh",
17     args:       ["--mode", "unattended", "--prefix", "/Applications/TI/UniFlash"],
18   }
19   # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809)
20   shimscript = "#{staged_path}/dslite"
21   binary shimscript
23   preflight do
24     File.write shimscript, <<~EOS
25       #!/bin/sh
26       exec '/Applications/TI/UniFlash/dslite.sh' "$@"
27     EOS
28   end
30   uninstall script: {
31     executable: "/Applications/TI/UniFlash/uninstall.app/Contents/MacOS/installbuilder.sh",
32     args:       ["--mode", "unattended"],
33     sudo:       true,
34   }
36   zap trash: [
37         "~/.ti/uniflash",
38         "~/Library/Application Support/Uniflash",
39         "~/Library/Caches/Uniflash",
40       ],
41       rmdir: "~/.ti"
42 end