mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-04 19:45:14 -04:00
45 lines
1.6 KiB
Cheetah
45 lines
1.6 KiB
Cheetah
{{ $projectName := env.Getenv "PROJECT" }}{{ $amdFilePath := env.Getenv "AMD" }}{{ $armFilePath := env.Getenv "ARM" }}
|
|
{{ $amdURL := env.Getenv "AMD_URL" }}{{ $armURL := env.Getenv "ARM_URL" }}
|
|
{{ $amdFile := filepath.Base $amdFilePath }}{{ $armFile := filepath.Base $armFilePath }}{{ $amdFileBytes := file.Read $amdFilePath }}
|
|
{{ $armFileBytes := file.Read $armFilePath }}# Netbird's UI Client Cask Formula
|
|
cask "{{ $projectName }}" do
|
|
version "{{ env.Getenv "VERSION" }}"
|
|
|
|
if Hardware::CPU.intel?
|
|
url "{{ $amdURL }}"
|
|
sha256 "{{ crypto.SHA256 $amdFileBytes }}"
|
|
app "netbird_ui_darwin", target: "Netbird UI.app"
|
|
else
|
|
url "{{ $armURL }}"
|
|
sha256 "{{ crypto.SHA256 $armFileBytes }}"
|
|
app "netbird_ui_darwin", target: "Netbird UI.app"
|
|
end
|
|
|
|
depends_on formula: "netbird"
|
|
|
|
postflight do
|
|
set_permissions "/Applications/Netbird UI.app/installer.sh", '0755'
|
|
set_permissions "/Applications/Netbird UI.app/uninstaller.sh", '0755'
|
|
end
|
|
|
|
postflight do
|
|
system_command "#{appdir}/Netbird UI.app/installer.sh",
|
|
args: ["#{version}"],
|
|
sudo: true
|
|
end
|
|
|
|
uninstall_preflight do
|
|
system_command "/bin/sh",
|
|
args: ["-c", <<~CMD],
|
|
launchctl bootout system/netbird 2>/dev/null || \
|
|
launchctl unload /Library/LaunchDaemons/netbird.plist 2>/dev/null || true
|
|
rm -f /Library/LaunchDaemons/netbird.plist
|
|
CMD
|
|
sudo: true
|
|
end
|
|
|
|
name "Netbird UI"
|
|
desc "Netbird UI Client"
|
|
homepage "https://www.netbird.io/"
|
|
end
|