commit 991dc5c58d39aa9a997e47052392a51af88b3718
parent 01095c36a89a4bffd6bd4b2e3ad293b594092660
Author: Byron Torres <b@torresjrjr.com>
Date: Thu, 15 Jul 2021 01:50:23 +0100
Fix redundant stylesheet minifications
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pdssg b/pdssg
@@ -76,11 +76,12 @@ prepare_dst() {
ASSETS_DIR="./ast" # No ending slash!
echo "Finding CSS files in assets directory ${ASSETS_DIR}"
- stylesheets=$(find -path "${ASSETS_DIR}/*.css")
+ stylesheets=$(find ${ASSETS_DIR} -regex ".*/[^.]*\.css")
for stylesheet in ${stylesheets}
do
echo "Minifying ${stylesheet}"
min_stylesheet="${stylesheet%.css}.min.css"
+ [ -f $min_stylesheet ] && continue
cp ${stylesheet} ${min_stylesheet}
vim ${min_stylesheet} -es --not-a-term +'
%s/\s*:\s*/:/ge