From 74008910f819d2423c4a5d7db93bd2ed9e218acb Mon Sep 17 00:00:00 2001 From: James Mills <1290234+prologic@users.noreply.github.com> Date: Sat, 18 Mar 2023 21:51:37 +1000 Subject: [PATCH] Fix posthook --- .zs/posthook | 18 +++++++++++++----- css/style.css | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.zs/posthook b/.zs/posthook index cc501db..c90ddc6 100755 --- a/.zs/posthook +++ b/.zs/posthook @@ -1,16 +1,24 @@ #!/bin/sh -set -e +set -ex CSS="simple style" JS="live" for css in $CSS; do - [ -f "$ZS_OUTDIR/css/$css.css" ] && minify -o "$ZS_OUTDIR/css/$css.min.css" "$ZS_OUTDIR/css/$css.css" - [ -f "$ZS_OUTDIR/css/$css.css" ]&& rm "$ZS_OUTDIR/css/$css.css" + if [ -f "$ZS_OUTDIR/css/$css.css" ]; then + minify -o "$ZS_OUTDIR/css/$css.min.css" "$ZS_OUTDIR/css/$css.css" + fi + if [ -f "$ZS_OUTDIR/css/$css.css" ]; then + rm "$ZS_OUTDIR/css/$css.css" + fi done for js in $JS; do - [ -f "$ZS_OUTDIR/js/$js.js" ] && minify -o "$ZS_OUTDIR/js/$js.min.js" "$ZS_OUTDIR/js/$js.js" - [ -f "$ZS_OUTDIR/js/$js.js" ] && rm "$ZS_OUTDIR/js/$js.js" + if [ -f "$ZS_OUTDIR/js/$js.js" ]; then + minify -o "$ZS_OUTDIR/js/$js.min.js" "$ZS_OUTDIR/js/$js.js" + fi + if [ -f "$ZS_OUTDIR/js/$js.js" ]; then + rm "$ZS_OUTDIR/js/$js.js" + fi done diff --git a/css/style.css b/css/style.css index ff205c7..43de5cd 100644 --- a/css/style.css +++ b/css/style.css @@ -20,4 +20,4 @@ a.anchor { /* Fences */ .blue { background-color: steelblue; padding: 5px; } #insideme { color: yellow; } -.red { background-color: red; } +.red { background-color: red; } \ No newline at end of file