Cleanup: minor simplification to icon scripts inkscape detection

Only set the inkscape_bin when the environment variable isn't set.
This commit is contained in:
Campbell Barton
2024-01-25 09:56:06 +11:00
parent bc39b1b27c
commit d44e09cf32
3 changed files with 17 additions and 15 deletions

View File

@@ -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,

View File

@@ -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 = (

View File

@@ -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,