From 5518802dddf237fef6d43c56c823da98be515a92 Mon Sep 17 00:00:00 2001 From: Otto Lote Date: Thu, 25 Apr 2024 09:39:20 +0200 Subject: [PATCH] Add check for ReplaceFile parameter so we don't error unless it's specified --- tools/convert.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/convert.sh b/tools/convert.sh index a9b9255..8421bb6 100755 --- a/tools/convert.sh +++ b/tools/convert.sh @@ -281,11 +281,13 @@ if ! test -f "${mdOutFile}"; then exit 1 fi -if [ ! -f "$replaceFilePath" ]; then - error '' "Unable to find replace file $replaceFilePath" 1 -else - jq -r 'to_entries | map("\(.key)/\(.value|tostring)") | .[]' "$replaceFilePath" | - xargs -I {} sed -i 's/{}/g' "$mdOutFile" +if test -n "${ReplaceFile}"; then + if [ ! -f "$replaceFilePath" ]; then + error '' "Unable to find replace file $replaceFilePath" 1 + else + jq -r 'to_entries | map("\(.key)/\(.value|tostring)") | .[]' "$replaceFilePath" | + xargs -I {} sed -i 's/{}/g' "$mdOutFile" + fi fi mdContent=$(cat "${mdOutFile}")