feat: Add __main_target path verification
This commit is contained in:
parent
d2e882f1ec
commit
d1a5eefb7a
@ -68,6 +68,15 @@ validate_targets() {
|
|||||||
# Set __main_target. This variable contains path to save local backups.
|
# Set __main_target. This variable contains path to save local backups.
|
||||||
# Files to additional targets will be coped from this directory.
|
# Files to additional targets will be coped from this directory.
|
||||||
__main_target="${file_targets[0]}"
|
__main_target="${file_targets[0]}"
|
||||||
|
# Fail if __main_target's path is not a directory
|
||||||
|
parse_uri "$__main_target"
|
||||||
|
if [ -d "$path" ]; then
|
||||||
|
__main_target="$path"
|
||||||
|
else
|
||||||
|
echo "Error: Path $path in $__main_target" \
|
||||||
|
"is not directory or does not exists" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user