made buildscripts running under Linux

This commit is contained in:
Marcel Peterkau 2024-01-26 21:41:27 +01:00
parent 8ef469b9f1
commit d01953409e

View File

@ -10,11 +10,22 @@ import subprocess
Import("env")
Import("projenv")
# Setze die Pfade zu den Tools als Variablen
html_minifier_path = os.path.join(os.getenv("APPDATA"), "npm", "html-minifier.cmd")
uglifyjs_path = os.path.join(os.getenv("APPDATA"), "npm", "uglifyjs.cmd")
terser_path = os.path.join(os.getenv("APPDATA"), "npm", "terser.cmd")
cssnano_path = os.path.join(os.getenv("APPDATA"), "npm", "cssnano.cmd")
# Überprüfe die Betriebssystemplattform
if platform.system() == "Windows":
# Setze die Pfade zu den Tools für Windows
html_minifier_path = os.path.join(os.getenv("APPDATA"), "npm", "html-minifier.cmd")
uglifyjs_path = os.path.join(os.getenv("APPDATA"), "npm", "uglifyjs.cmd")
terser_path = os.path.join(os.getenv("APPDATA"), "npm", "terser.cmd")
cssnano_path = os.path.join(os.getenv("APPDATA"), "npm", "cssnano.cmd")
elif platform.system() == "Linux":
# Setze die Namen der Tools für Linux
html_minifier_path = "html-minifier"
uglifyjs_path = "uglifyjs"
terser_path = "terser"
cssnano_path = "cssnano"
else:
# Hier könntest du weitere Bedingungen für andere Betriebssysteme hinzufügen
raise Exception("Unterstütztes Betriebssystem nicht erkannt")
def minify_html(input_path, output_path):