diff --git a/src/lib/source.sh b/src/lib/source.sh index 007b555..8d96804 100644 --- a/src/lib/source.sh +++ b/src/lib/source.sh @@ -68,6 +68,15 @@ validate_targets() { # Set __main_target. This variable contains path to save local backups. # Files to additional targets will be coped from this directory. __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 }