Icons: Make blender_icons_geom_update.py support macOS
authorWilliam Reynish <billrey@me.com>
Sun, 3 Mar 2019 18:02:14 +0000 (19:02 +0100)
committerWilliam Reynish <billrey@me.com>
Sun, 3 Mar 2019 18:02:14 +0000 (19:02 +0100)
release/datafiles/blender_icons_geom_update.py

index 0b1cbf4072204df58deb8d02e8b96fee529d94cc..c9c95f5289960f251cc6f956d8fe141a8c8bca02 100755 (executable)
@@ -3,6 +3,7 @@
 # This script updates icons from the BLEND file
 import os
 import subprocess
+import sys
 
 
 def run(cmd):
@@ -39,6 +40,11 @@ blender_bin = os.environ.get("BLENDER_BIN", "blender")
 if not os.path.exists(blender_bin):
     blender_bin = os.path.join(ROOTDIR, "blender.bin")
 
+if sys.platform == 'darwin':
+    blender_app_path = '/Applications/blender.app/Contents/MacOS/blender'
+    if os.path.exists(blender_app_path):
+        blender_bin = blender_app_path
+
 icons_blend = (
     os.path.join(ROOTDIR, "..", "lib", "resources", "icon_geom.blend"),
 )