From 0e1bb8a3a6351b17423625160afac397bc51773a Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Tue, 29 Nov 2022 21:29:59 +0100 Subject: [PATCH] add live.sh to style 49 --- templates/49/.gitignore | 2 +- templates/49/live.sh | 6 ++++++ templates/49/render.sh | 12 +++++++----- 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100755 templates/49/live.sh diff --git a/templates/49/.gitignore b/templates/49/.gitignore index a9b203a..b751272 100644 --- a/templates/49/.gitignore +++ b/templates/49/.gitignore @@ -1 +1 @@ -main.js +main-*.js diff --git a/templates/49/live.sh b/templates/49/live.sh new file mode 100755 index 0000000..d74dd99 --- /dev/null +++ b/templates/49/live.sh @@ -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 diff --git a/templates/49/render.sh b/templates/49/render.sh index 1b11b91..34b51a7 100755 --- a/templates/49/render.sh +++ b/templates/49/render.sh @@ -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