add live.sh to style 49

This commit is contained in:
Peder Bergebakken Sundt 2022-11-29 21:29:59 +01:00
parent 628efd7630
commit 0e1bb8a3a6
3 changed files with 14 additions and 6 deletions

View File

@ -1 +1 @@
main.js
main-*.js

6
templates/49/live.sh Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
set -eo pipefail
git ls-files | entr -p ./example.sh

View File

@ -3,14 +3,16 @@
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
set -eo pipefail
if test "main.js" -ot "main.nim" \
|| test "main.js" -ot "main.nimle" \
|| test "main.js" -ot "main.nimja"
VERSION="${1-release}"
if test "main-$VERSION.js" -ot "main.nim" \
|| test "main-$VERSION.js" -ot "main.nimle" \
|| test "main-$VERSION.js" -ot "main.nimja"
then
>&2 nimble js main -d:${1-release}
>&2 nimble js main -o:main-"$VERSION".js -d:"$VERSION"
fi
j2 -f json style.html.j2 <({
echo "card_js = $(cat main.js | jq -s --raw-input);"
echo "card_js = $(cat main-"$VERSION".js | jq -s --raw-input);"
echo "card_css_style = $(sass --style expanded style.scss | jq -s --raw-input);"
} | gron -u) --filters ../../filters.py --customize ../../environ.py