2022-05-21 18:42:56 +02:00
|
|
|
{{ $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 }}"
|
2024-10-17 20:39:59 +02:00
|
|
|
app "netbird_ui_darwin", target: "Netbird UI.app"
|
2022-05-21 18:42:56 +02:00
|
|
|
else
|
|
|
|
url "{{ $armURL }}"
|
|
|
|
sha256 "{{ crypto.SHA256 $armFileBytes }}"
|
2024-10-17 20:39:59 +02:00
|
|
|
app "netbird_ui_darwin", target: "Netbird UI.app"
|
2022-05-21 18:42:56 +02:00
|
|
|
end
|
|
|
|
|
2022-05-22 18:53:47 +02:00
|
|
|
depends_on formula: "netbird"
|
|
|
|
|
2022-05-25 19:41:03 +02:00
|
|
|
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 "#{appdir}/Netbird UI.app/uninstaller.sh",
|
|
|
|
sudo: false
|
|
|
|
end
|
|
|
|
|
2022-05-21 18:42:56 +02:00
|
|
|
name "Netbird UI"
|
|
|
|
desc "Netbird UI Client"
|
|
|
|
homepage "https://www.netbird.io/"
|
2024-10-17 20:39:59 +02:00
|
|
|
end
|