From 283c1c3ba0fc5ebbfaf5511a7e40b061bd02d152 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 19 Jun 2024 18:01:51 +0800 Subject: [PATCH] Set up python if missing in mac builder script Signed-off-by: Claudio Cambra --- admin/osx/craft-client.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/admin/osx/craft-client.swift b/admin/osx/craft-client.swift index 9f8766fec..4d8461aa3 100644 --- a/admin/osx/craft-client.swift +++ b/admin/osx/craft-client.swift @@ -81,3 +81,20 @@ if commandExists("inkscape") { print("Inkscape installed.") } +if commandExists("python3") { + print("Python 3 is installed.") +} else { + if commandExists("pyenv") { + print("Pyenv is installed.") + } else { + guard shell("brew install pyenv") == 0 else { + print("Failed to install Pyenv.") + exit(1) + } + } + + guard shell ("pyenv install 3.12.4") == 0 else { + print("Failed to install Python 3.") + exit(1) + } +} -- 2.30.2