implement check for missing locations

This commit is contained in:
itwrx
2023-07-01 13:16:45 -05:00
parent a1b2743960
commit eee7038808
3 changed files with 43 additions and 6 deletions

View File

@@ -43,6 +43,30 @@ proc seqToString(strSeq: seq[string]):string =
return newStr
proc locationsExist*(routine: Routine): bool =
var logMsg: string
var exists: seq[int]
for source in routine.sources:
if dirExists(source) or fileExists(source):
exists.add(1)
else:
logMsg = "(" & nowDT & ")" & " Source not found: " & source
writeErrorToLog(logMsg)
exists.add(0)
for dest in routine.destinations:
if dirExists(dest) or fileExists(dest):
exists.add(1)
else:
logMsg = "(" & nowDT & ")" & " Destination not found: " & dest
writeErrorToLog(logMsg)
exists.add(0)
if 0 in exists:
return false
else:
return true
#[proc matches*(routine: Routine, filter: string): bool =
## Checks if the routine matches the given filter.
## This function is used to search the list of routines.