From e3ca99840fb0520036b4d0b3784dc3eeb09f6934 Mon Sep 17 00:00:00 2001 From: "Dominik D. Geyer" Date: Mon, 3 Dec 2012 00:03:51 +0100 Subject: [PATCH] Exit with code 1 and message if target is neither a regular file nor a directory --- gitwatch.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitwatch.sh b/gitwatch.sh index ced3781..e735097 100755 --- a/gitwatch.sh +++ b/gitwatch.sh @@ -95,7 +95,8 @@ elif [ -f $1 ]; then GITADD="$IN" # add only the selected file to index GITINCOMMAND="" # no need to add anything more to "commit" call else - exit + echo >&2 "Error: The target is neither a regular file nor a directory." + exit 1 fi while true; do