From d96aeea09bd0c98d2e8570840412a7efbcbb56a3 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 10 Mar 2011 18:27:41 +0100 Subject: check if the target file exists Signed-off-by: Florian Pritz --- fb.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fb.in b/fb.in index 48dc777..f6877ae 100644 --- a/fb.in +++ b/fb.in @@ -31,6 +31,13 @@ do_upload() { file="$1" basefilename="`basename -- "$file"`" basedirname="`dirname -- "$file"`" + + if [ ! -e "$file" ]; then + echo "Error: File \"$file\" doesn't exist" >&2 + EXITCODE=1 + return 1 + fi + if [ -d "$file" ]; then cd "$basedirname" tar $TAROPTS -cf "$TMPDIR/$basefilename$TAREXT" -- "$basefilename" -- cgit v1.2.3-24-g4f1b