Skip to content

Commit

Permalink
Use a safer sed separator in build script to avoid conflicts (#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
thrashwerk authored Jan 14, 2025
1 parent f3760e8 commit 7c2e292
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build.books.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

set -e

# safer separator for sed
sep=$'\001'

if [ -v GITHUB_REF_NAME ]; then
sed "s/%%FOOTER_VERSION%%/${GITHUB_REF_NAME}/" meta.tmpl.tex > meta.tex
sed "s${sep}%%FOOTER_VERSION%%${sep}${GITHUB_REF_NAME}${sep}" meta.tmpl.tex > meta.tex
else
sed "s/%%FOOTER_VERSION%%/UNDEFINED VERSION/" meta.tmpl.tex > meta.tex
sed "s${sep}%%FOOTER_VERSION%%${sep}UNDEFINED VERSION${sep}" meta.tmpl.tex > meta.tex
fi

docker run --rm -v `pwd`:/data uppalabharath/pandoc-latex-cjk:latest --from=gfm+rebase_relative_paths -o learn-go-with-tests.pdf \
Expand Down

0 comments on commit 7c2e292

Please sign in to comment.