From 1a13b7c85fbc3b0cc364a9f2166d767a33e94c26 Mon Sep 17 00:00:00 2001 From: fritz-hh Date: Thu, 25 Sep 2014 22:03:45 +0200 Subject: [PATCH] Check if the input file exist Previously I checked only if the folder in which the input file should be exists --- OCRmyPDF.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OCRmyPDF.sh b/OCRmyPDF.sh index 2b831153..3ba8a148 100755 --- a/OCRmyPDF.sh +++ b/OCRmyPDF.sh @@ -119,9 +119,10 @@ if [ "$#" -ne "2" ]; then exit $EXIT_BAD_ARGS fi -! absolutePath "$1" > /dev/null \ - && echo "The folder in which the input file should be located does not exist. Exiting..." && exit $EXIT_BAD_ARGS +[ ! -f "$1" ] \ + && echo "The input file does not exist. Exiting..." && exit $EXIT_BAD_ARGS FILE_INPUT_PDF="`absolutePath "$1"`" + ! absolutePath "$2" > /dev/null \ && echo "The folder in which the output file should be generated does not exist. Exiting..." && exit $EXIT_BAD_ARGS FILE_OUTPUT_PDFA="`absolutePath "$2"`"