mirror of
https://git.mills.io/prologic/zs-starter-template.git
synced 2024-11-23 13:56:03 +03:00
Fix posthook to work no matter what the structure of assets
This commit is contained in:
parent
9be5115b6b
commit
303eebf94b
17
.zs/posthook
17
.zs/posthook
@ -2,13 +2,16 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
CSS="bahunya site"
|
minify_assets() {
|
||||||
JS="live"
|
p="$1"
|
||||||
|
t="$2"
|
||||||
|
|
||||||
for css in $CSS; do
|
find "$p" -type f -name "*.$t" | while read -r file; do
|
||||||
minify -o "$ZS_OUTDIR/css/$css.min.css" "$ZS_OUTDIR/css/$css.css"
|
name="${file#"$p"}"
|
||||||
|
name="${name#"/"}"
|
||||||
|
minify -o "${p}/${name}" "$file"
|
||||||
done
|
done
|
||||||
|
}
|
||||||
|
|
||||||
for js in $JS; do
|
minify_assets "$ZS_OUTDIR" "css"
|
||||||
minify -o "$ZS_OUTDIR/js/$js.min.js" "$ZS_OUTDIR/js/$js.js"
|
minify_assets "$ZS_OUTDIR" "js"
|
||||||
done
|
|
||||||
|
Loading…
Reference in New Issue
Block a user