Skip to content

Commit

Permalink
Fix shellcheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
reijoh committed Apr 5, 2024
1 parent d0031aa commit ac56f4a
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tools/convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ if [ "$(printf '%s' "${OutFile}" | tail -c 3)" = '.md' ]; then
elif [ "$(printf '%s' "${inputFilePath}" | tail -c 3)" = '.md' ]; then
mdOutFile="${inputFilePath}"
else
mdOutFile="${OutFile/.pdf/}.md"
mdOutFile="$(echo "$OutFile" | sed 's/.pdf$//g').md"
fi
if [ "$(printf '%s' "${inputFilePath}" | tail -c 6)" = '.order' ]; then
info "Merge markdown files in ${inputFilePath}"
Expand Down Expand Up @@ -315,14 +315,14 @@ fi
currentDate=$(date "+%B %d, %Y")
templateCoverFilePath=$(get_file_path "${Template}-cover.png" "${DocsPath}")
if ! test -f "${templateCoverFilePath}"; then
templateCoverFilePath=$(get_file_path "${templateFilePath/.tex/}-cover.png" '')
templateCoverFilePath=$(get_file_path "$(echo "$templateFilePath" | sed 's/.tex$//g')-cover.png" '')
if [ "${Template}" = 'designdoc' ] && ! test -f "${templateCoverFilePath}"; then
error '' "Unable to find template cover file ${templateCoverFilePath}" 1
fi
fi
templateLogoFilePath=$(get_file_path "${Template}-logo.png" "${DocsPath}")
if ! test -f "${templateLogoFilePath}"; then
templateLogoFilePath=$(get_file_path "${templateFilePath/.tex/}-logo.png" '')
templateLogoFilePath=$(get_file_path "$(echo "$templateFilePath" | sed 's/.tex$//g')-logo.png" '')
if [ "${Template}" = 'designdoc' ] && ! test -f "${templateLogoFilePath}"; then
error '' "Unable to find template logo file ${templateLogoFilePath}" 1
fi
Expand All @@ -333,9 +333,9 @@ if test -n "${mdContent}"; then
if ! test -f "${metaFilePath}"; then
metaFilePath=$(get_file_path 'metadata.json' "${DocsPath}")
if ! test -f "${metaFilePath}"; then
metaFilePath=$(get_file_path "${Template}-metadata.json" "$(dirname ${templateFilePath})")
metaFilePath=$(get_file_path "${Template}-metadata.json" "$(dirname "${templateFilePath}")")
if ! test -f "${metaFilePath}"; then
metaFilePath=$(get_file_path 'metadata.json' "$(dirname ${templateFilePath})")
metaFilePath=$(get_file_path 'metadata.json' "$(dirname "${templateFilePath}")")
fi
fi
fi
Expand Down Expand Up @@ -391,22 +391,22 @@ META_DATA_FIXED
# Change to the docs path so image paths can be relative
cd "${DocsPath}"
printf '%s' "${mdContent}" | pandoc \
--columns=${Columns} \
--columns="${Columns}" \
--dpi=300 \
--filter pandoc-latex-environment \
--from=${InputFormat} \
--from="${InputFormat}" \
--standalone \
--listings \
--metadata=date:${currentDate} \
--metadata=logo:${templateLogoFilePath} \
--metadata=project:${Project} \
--metadata=subtitle:${Subtitle} \
--metadata=title:${Title} \
--metadata=titlepage-top-cover-image:${templateCoverFilePath} \
--metadata=date:"${currentDate}" \
--metadata=logo:"${templateLogoFilePath}" \
--metadata=project:"${Project}" \
--metadata=subtitle:"${Subtitle}" \
--metadata=title:"${Title}" \
--metadata=titlepage-top-cover-image:"${templateCoverFilePath}" \
--metadata-file="${metaFilePath}" \
--metadata-file="${metaFilePathFixed}" \
--output="${OutFile}" \
--pdf-engine=${PDFEngine} \
--pdf-engine="${PDFEngine}" \
--template="${templateFilePath}"
cd "${currentPath}"
fi
Expand Down

0 comments on commit ac56f4a

Please sign in to comment.