This commit is contained in:
MLH
2024-12-10 01:50:37 +01:00
parent 5d829fe228
commit 23ca0c1fa8

View File

@ -1,3 +1,4 @@
from ast import mod
import os
import shutil
import yaml
@ -195,7 +196,7 @@ def modifyFiles(config, destinationDirectory):
else:
print(f" Text already replaced: {old_text} -> {new_text}")
errorList['modWarnings'] += 1
# Write modified contents
with open(filePath, 'w', encoding='utf-8') as f:
@ -218,7 +219,7 @@ def modifyFiles(config, destinationDirectory):
errorList["modifications"] += 1
continue
print(f"\nFile modification process completed with {errorList['modifications']} errors.\n")
print(f"\nFile modification process completed with {errorList['modifications']} errors and {errorList['modWarnings']} warnings.\n")
def main():
@ -252,7 +253,7 @@ def main():
print(f"{errorList['copies']} copy errors.")
print(f"{errorList['modifications']} modification errors.")
elif errorList["warnings"] > 0:
print(f"All operations in {destinationDirectory} from {configPath} completed successfully! But there were {errorList['warnings']} warnings. Mybe you should check them.")
print(f"All operations in {destinationDirectory} from {configPath} completed successfully! But there were {errorList['modWarnings'] + errorList['copyWarnings']} warnings. Mybe you should check them.")
else:
print(f"All operations in {destinationDirectory} from {configPath} completed successfully!")