From dd496bfcc7635618a1a294167d6aa1d13cdd4950 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 19 Jun 2024 18:01:36 +0800 Subject: [PATCH] Configure xcode command line tools if missing in mac builder Signed-off-by: Claudio Cambra --- admin/osx/craft-client.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/admin/osx/craft-client.swift b/admin/osx/craft-client.swift index b4afc8447d..9f8766fec8 100644 --- a/admin/osx/craft-client.swift +++ b/admin/osx/craft-client.swift @@ -47,6 +47,16 @@ func commandExists(_ command: String) -> Bool { print("Configuring build tooling.") +if commandExists("git") { + print("Git is installed.") +} else { + print("Git is missing. Installing xcode command line tools.") + guard shell("xcode-select --install") == 0 else { + print("Failed to install xcode command line tools.") + exit(1) + } +} + if commandExists("brew") { print("Brew is installed.") } else {