fixes
This commit is contained in:
@ -1,7 +1,5 @@
|
|||||||
from calendar import c
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
from tabnanny import check
|
|
||||||
import yaml
|
import yaml
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
@ -25,7 +23,7 @@ def loadConfig(configPath):
|
|||||||
if not config:
|
if not config:
|
||||||
raise ValueError("Empty configuration file")
|
raise ValueError("Empty configuration file")
|
||||||
|
|
||||||
print("Configuration loaded successfully.\n")
|
print("Configuration loaded successfully.")
|
||||||
return config
|
return config
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
print(f"Error: Configuration file not found at ./{configPath}")
|
print(f"Error: Configuration file not found at ./{configPath}")
|
||||||
@ -59,13 +57,13 @@ def copySources(config, destinationDirectory):
|
|||||||
# Check for absolute paths in target and correct them if necessary
|
# Check for absolute paths in target and correct them if necessary
|
||||||
if os.path.isabs(checkTargetPath):
|
if os.path.isabs(checkTargetPath):
|
||||||
targetPath = os.path.normpath(os.path.join(destinationDirectory, checkTargetPath.lstrip('./')))
|
targetPath = os.path.normpath(os.path.join(destinationDirectory, checkTargetPath.lstrip('./')))
|
||||||
raise ValueError(f"Absolute path incorrect: Corrected {targetPath} to {targetPath}.")
|
raise ValueError(f"Absolute path incorrect: Corrected {checkTargetPath} to {targetPath}.")
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
sourcePath = source
|
sourcePath = source
|
||||||
targetPath = os.path.join(destinationDirectory, os.path.basename(sourcePath))
|
#targetPath = os.path.join(destinationDirectory, os.path.basename(sourcePath))
|
||||||
#targetPath = os.path.normpath(os.path.join(destinationDirectory, os.path.basename(sourcePath).lstrip('./')))
|
targetPath = os.path.normpath(os.path.join(destinationDirectory, os.path.basename(sourcePath)))
|
||||||
|
|
||||||
# Check if source exists
|
# Check if source exists
|
||||||
if not os.path.exists(sourcePath):
|
if not os.path.exists(sourcePath):
|
||||||
|
Reference in New Issue
Block a user