implement check for missing locations
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user