Skip to content

Commit

Permalink
Add check for ReplaceFile parameter so we don't error unless it's spe…
Browse files Browse the repository at this point in the history
…cified
  • Loading branch information
ottolote committed Apr 25, 2024
1 parent 743da7f commit 5518802
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tools/convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 5518802

Please sign in to comment.