From: Claudio Cambra Date: Wed, 19 Jun 2024 09:47:56 +0000 (+0800) Subject: Install brew through builder if not present X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~6^2~172 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=705cb09d8d5508d1b8ccf79939debd2121721d11;p=nextcloud-desktop.git Install brew through builder if not present Signed-off-by: Claudio Cambra --- diff --git a/admin/osx/craft-client.swift b/admin/osx/craft-client.swift index e5e94f95f..e5007bdef 100644 --- a/admin/osx/craft-client.swift +++ b/admin/osx/craft-client.swift @@ -44,3 +44,19 @@ func shell(_ commands: String..., env: [String: String]? = nil, quiet: Bool = fa func commandExists(_ command: String) -> Bool { return run("/usr/bin/type", command, quiet: true) == 0 } + +print("Configuring build tooling.") + +if commandExists("brew") { + print("Brew is installed.") +} else { + print("Installing Homebrew...") + guard shell( + "curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | /bin/bash", + env: ["NONINTERACTIVE": "1"] + ) == 0 else { + print("Failed to install Homebrew.") + exit(1) + } + print("Brew installed.") +}