fail instead of looping when no mount target can be read

This commit is contained in:
2026-08-22 07:45:56 +02:00
parent 56b619372d
commit 01c299e242
+2 -1
View File
@@ -360,9 +360,10 @@ case "$action" in
target=${args[2]} target=${args[2]}
if [ -z "$target" ]; then if [ -z "$target" ]; then
[ ! -t 0 ] && echo "Error: no target path given and stdin is not a terminal" >&2 && exit 1
while [ -z "$target" ]; do while [ -z "$target" ]; do
echo -n "Target path: " echo -n "Target path: "
read -r target ! read -r target && [ -z "$target" ] && echo "Error: no target path given" >&2 && exit 1
[ -d "$target" ] && break [ -d "$target" ] && break
echo -e "\nError: $target: no such directory\n" >&2 echo -e "\nError: $target: no such directory\n" >&2
target='' target=''