fix logic typo in before_text

This commit is contained in:
MLH
2024-12-10 01:59:07 +01:00
parent 8957228794
commit c72a06b149

View File

@ -38,7 +38,7 @@ def loadConfig(configPath):
def ensureDirectory(path):
"""Ensure that a directory exists."""
print(f"\nChecking or creating directory: {path}")
print(f"\nChecking for or creating directory: {path}")
os.makedirs(path, exist_ok=True)
@ -178,9 +178,9 @@ def modifyFiles(config, destinationDirectory):
raise ValueError(f"Text '{before_text}' not found in file: {filePath}")
elif insert_text not in content:
print(f" Inserting text before: {before_text}")
content = content.replace(before_text, before_text + insert_text)
content = content.replace(before_text, insert_text + before_text)
else:
print(f" Text already present after: {before_text}")
print(f" Text already present before: {before_text}")
errorList['modWarnings'] += 1