Set up python if missing in mac builder script
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 19 Jun 2024 10:01:51 +0000 (18:01 +0800)
committerClaudio Cambra <developer@claudiocambra.com>
Mon, 8 Jul 2024 07:41:45 +0000 (15:41 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
admin/osx/craft-client.swift

index 9f8766fec8152c3344e9c78630743b29a3131ec1..4d8461aa3ec095d9a021df33ef9f8efe4bcdb289 100644 (file)
@@ -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)
+    }
+}