Skip to content

Commit

Permalink
hotfix: workaround for minify being too aggressive with the template
Browse files Browse the repository at this point in the history
  • Loading branch information
Wazzaps committed May 6, 2023
1 parent 96cf008 commit 1bd94a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ set -ex
cd "$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"

rm -rf ./dist ./build
minify ./ampm/index_ui.html -o ./ampm/index_ui.min.html
# 1. Wrap each {{ }} in <ignoreme> </ignoreme> to prevent minify from removing them
# 2. Minify
# 3. Remove <ignoreme> </ignoreme>
sed -E 's:(\{\{[^}]+ [^}]+}}):<ignoreme>\1</ignoreme>:g' < ./ampm/index_ui.html | \
minify --type html | \
sed -E 's:<ignoreme>([^<]+)</ignoreme>:\1:g' > ./ampm/index_ui.min.html
docker run --rm --env=PYTHONPATH='/code/vendor' --env=GITHUB_WORKSPACE='/code' -v "$PWD":/code wazzaps/pyinstaller-manylinux-py38 --clean --noconfirm --name=ampm --add-binary /usr/local/lib/libcrypt.so.2:. --add-data /code/ampm/index_ui.html:. --add-data /code/ampm/index_ui.min.html:. /code/ampm/cli.py
strip ./dist/ampm/*so* ./dist/ampm/ampm ./dist/ampm/lib-dynload/*
cp ./ampm/ampm.sh ./dist/ampm/ampm.sh
Expand Down

0 comments on commit 1bd94a6

Please sign in to comment.