..
This commit is contained in:
@ -38,13 +38,13 @@ def loadConfig(configPath):
|
|||||||
|
|
||||||
def ensureDirectory(path):
|
def ensureDirectory(path):
|
||||||
"""Ensure that a directory exists."""
|
"""Ensure that a directory exists."""
|
||||||
print(f"\nChecking/creating directory: {path}")
|
print(f"\nChecking or creating directory: {path}")
|
||||||
os.makedirs(path, exist_ok=True)
|
os.makedirs(path, exist_ok=True)
|
||||||
|
|
||||||
|
|
||||||
def copySources(config, destinationDirectory):
|
def copySources(config, destinationDirectory):
|
||||||
"""Copy files and folders according to copy rules."""
|
"""Copy files and folders according to copy rules."""
|
||||||
print("Starting source file/folder copy process...")
|
print("Starting source file/folder copy and replace process...")
|
||||||
for rule in config.get('copy_rules', []):
|
for rule in config.get('copy_rules', []):
|
||||||
for source in rule.get('sources', []):
|
for source in rule.get('sources', []):
|
||||||
try:
|
try:
|
||||||
@ -219,7 +219,7 @@ def main():
|
|||||||
print(f"{errorList['copies']} copy errors.")
|
print(f"{errorList['copies']} copy errors.")
|
||||||
print(f"{errorList['modifications']} modification errors.")
|
print(f"{errorList['modifications']} modification errors.")
|
||||||
else:
|
else:
|
||||||
print(f"All operations in {destinationDirectory} completed successfully.")
|
print(f"All operations in {destinationDirectory} from {configPath} completed successfully!")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Reference in New Issue
Block a user