From 30000558407f29b4fde3c6780bbd91b01987ad3c Mon Sep 17 00:00:00 2001 From: merakor Date: Sat, 4 Apr 2020 17:09:55 +0000 Subject: kiss-owns: meaningful output if arg is a directory FossilOrigin-Name: 07484c8f6786df7a8163e913a69acfefd4f64b66053bb7ad934d29a7a790b6ca --- contrib/kiss-owns | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/kiss-owns b/contrib/kiss-owns index 249c52c..1ab7c55 100755 --- a/contrib/kiss-owns +++ b/contrib/kiss-owns @@ -8,7 +8,9 @@ file=$(readlink -f "$KISS_ROOT/${1##$KISS_ROOT}") # Check if the file exists and exit if it is not. [ -f "$file" ] || { - printf '%s\n' "error: file '$1' doesn't exist." >&2 + [ -d "$file" ] && printf '%s\n' \ + "error: please specify a file instead of a directory" >&2 || + printf '%s\n' "error: file '$1' doesn't exist." >&2 exit 1 } -- cgit v1.2.3