From d44e09cf32ea1c99012ba4dbcb0aeae2cf9c30e7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 25 Jan 2024 09:56:06 +1100 Subject: [PATCH] Cleanup: minor simplification to icon scripts inkscape detection Only set the inkscape_bin when the environment variable isn't set. --- release/datafiles/alert_icons_update.py | 10 +++++----- release/datafiles/blender_icons_update.py | 11 ++++++----- release/datafiles/prvicons_update.py | 11 ++++++----- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/release/datafiles/alert_icons_update.py b/release/datafiles/alert_icons_update.py index 29286cb01b7..7d75b5e87bc 100755 --- a/release/datafiles/alert_icons_update.py +++ b/release/datafiles/alert_icons_update.py @@ -10,11 +10,11 @@ import sys BASEDIR = os.path.abspath(os.path.dirname(__file__)) -if sys.platform == 'darwin': - inkscape_bin = '/Applications/Inkscape.app/Contents/MacOS/inkscape' -else: - inkscape_bin = "inkscape" -inkscape_bin = os.environ.get("INKSCAPE_BIN", inkscape_bin) +if not (inkscape_bin := os.environ.get("INKSCAPE_BIN")): + if sys.platform == 'darwin': + inkscape_bin = '/Applications/Inkscape.app/Contents/MacOS/inkscape' + else: + inkscape_bin = "inkscape" cmd = ( inkscape_bin, diff --git a/release/datafiles/blender_icons_update.py b/release/datafiles/blender_icons_update.py index 7961d60beb8..9590544b77a 100755 --- a/release/datafiles/blender_icons_update.py +++ b/release/datafiles/blender_icons_update.py @@ -26,11 +26,12 @@ if sys.platform[:3] == "win": env["SystemDrive"] = os.environ.get("SystemDrive", "") env["SystemRoot"] = os.environ.get("SystemRoot", "") -if sys.platform == 'darwin': - inkscape_bin = '/Applications/Inkscape.app/Contents/MacOS/inkscape' -else: - inkscape_bin = "inkscape" -inkscape_bin = os.environ.get("INKSCAPE_BIN", inkscape_bin) +if not (inkscape_bin := os.environ.get("INKSCAPE_BIN")): + if sys.platform == 'darwin': + inkscape_bin = '/Applications/Inkscape.app/Contents/MacOS/inkscape' + else: + inkscape_bin = "inkscape" + blender_bin = os.environ.get("BLENDER_BIN", "blender") cmd = ( diff --git a/release/datafiles/prvicons_update.py b/release/datafiles/prvicons_update.py index 762b06bbcf2..f12fce7e1e4 100755 --- a/release/datafiles/prvicons_update.py +++ b/release/datafiles/prvicons_update.py @@ -10,11 +10,12 @@ import sys BASEDIR = os.path.abspath(os.path.dirname(__file__)) -if sys.platform == 'darwin': - inkscape_bin = '/Applications/Inkscape.app/Contents/MacOS/inkscape' -else: - inkscape_bin = "inkscape" -inkscape_bin = os.environ.get("INKSCAPE_BIN", inkscape_bin) +if not (inkscape_bin := os.environ.get("INKSCAPE_BIN")): + if sys.platform == 'darwin': + inkscape_bin = '/Applications/Inkscape.app/Contents/MacOS/inkscape' + else: + inkscape_bin = "inkscape" + cmd = ( inkscape_bin,