From 1723afbb4cf1712760f43fea23a7e7ca0d9fa193 Mon Sep 17 00:00:00 2001 From: Reidar Johansen Date: Tue, 16 Jan 2024 16:05:05 +0000 Subject: [PATCH] Fix orderfile param bug --- tools/mdconvert.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/mdconvert.sh b/tools/mdconvert.sh index 9fb52e5..32f94a7 100755 --- a/tools/mdconvert.sh +++ b/tools/mdconvert.sh @@ -145,7 +145,7 @@ process_params() { shift 2 ;; -o|--orderfile) - OrderFile=$(test_arg false "$@") + OrderFile=$(test_arg false '' "$@") shift 2 ;; -out|--outfile) @@ -206,10 +206,16 @@ fi if ! echo "$DocsPath" | grep -Eq '^[a-zA-Z]:\\.*' && ! echo "$DocsPath" | grep -Eq '^/.*'; then DocsPath="${currentPath}/${DocsPath}" fi +if ! [ -d "${DocsPath}" ]; then + error '' "Unable to find folder ${DocsPath}" 1 +fi scriptPath=$(dirname -- $(realpath "$0")) # Get path to docs files in the same folder as the docs historyFilePath=$(get_file_path "$HistoryFile" $DocsPath) orderFilePath=$(get_file_path "$OrderFile" $DocsPath) +if ! [ -f "${orderFilePath}" ]; then + error '' "Unable to find order file ${orderFilePath}" 1 +fi replaceFilePath=$(get_file_path "$ReplaceFile" $DocsPath) # Get path to template files in the same folder as the script templateFilePath=$(get_file_path "${Template}.tex" $scriptPath)