This commit is contained in:
Frank
2022-10-11 21:51:09 +02:00
parent 9f91de26ca
commit a315bc49af
+7 -1
View File
@@ -13,6 +13,7 @@ from pathlib import Path
from zipfile import ZipFile from zipfile import ZipFile
from shutil import rmtree, copy from shutil import rmtree, copy
import argparse import argparse
import filecmp
def update(f: Path, MooseLua: Path, Temp: Path): def update(f: Path, MooseLua: Path, Temp: Path):
""" """
@@ -28,7 +29,7 @@ def update(f: Path, MooseLua: Path, Temp: Path):
# Folder where script is located # Folder where script is located
ScriptDir=Temp/"l10n/DEFAULT/" ScriptDir=Temp/"l10n/DEFAULT/"
# Check if that directory exists! GRP-600 - Respawn.miz was errorrous! # Check if that directory exists! GRP-600 - Respawn.miz was faulty
if not ScriptDir.is_dir(): if not ScriptDir.is_dir():
print(f"WARNING: {ScriptDir.name} does not exit!") print(f"WARNING: {ScriptDir.name} does not exit!")
return return
@@ -43,6 +44,11 @@ def update(f: Path, MooseLua: Path, Temp: Path):
else: else:
print(f"Warning: expected script file {ScriptFile} does NOT exist in miz file!") print(f"Warning: expected script file {ScriptFile} does NOT exist in miz file!")
# Check if Moose.lua file is already.
if filecmp(MooseLua, ScriptDir/"Moose.lua"):
print(f"INFO: Moose.lua file is up-to-date ==> Nothing to do!")
else:
# Copy Moose.lua to temp dir. # Copy Moose.lua to temp dir.
copy(MooseLua, ScriptDir/"Moose.lua") copy(MooseLua, ScriptDir/"Moose.lua")