update render.sh

changed sass engine, added skip to other step.
This commit is contained in:
Atlas Cove 2023-11-05 14:01:23 +00:00
parent a5640f2a81
commit 874b02ef67
1 changed files with 9 additions and 17 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# render.sh: part of the tape-and-string framework. # render.sh: part of the tape-and-string framework.
# v3.5-p0 #V:3.6-p1
#B: Load #B: Load
enable -f /usr/lib/bash/csv csv enable -f /usr/lib/bash/csv csv
declare -A title declare -A title
@ -43,29 +43,21 @@ function docs {
fi fi
done done
} }
function sass { function sassfn {
if ! test -d out; then if ! test -d out; then
err "Cannot render, directory 'out' does not exist, run ./render.sh dir" err "Cannot render, directory 'out' does not exist, run ./render.sh dir"
return 1 exit 1
fi fi
local i o sass
sass=(`./pfiles.rb sass`)
inf "Rendering sass files..." inf "Rendering sass files..."
if [ ${#sass[@]} -eq 0 ]; then sass --no-source-map in/css:out/css
inf "No .sass files detected, skipping"
return 0
else
for i in ${sass[@]}; do
o="${i/in/out}"
o="${o/.s[ac]/.c}"
echo "'$i' -> '$o'"
sassc -t expanded -a $i | sed '/^$/d' > $o
done
fi
} }
function other { function other {
local other=`./pfiles.rb rest` local other=`./pfiles.rb rest`
for i in $other; do for i in $other; do
if test -f $i; then
inf "Skipping $i, file/hardlink exists..."
continue
fi
ln -v $i ${i/in/out} ln -v $i ${i/in/out}
done done
} }
@ -121,7 +113,7 @@ case $1 in
dir) dirs;; dir) dirs;;
doc) docs;; doc) docs;;
docs) docs;; docs) docs;;
s[ac]ss) sass;; s[ac]ss) sassfn;;
other) dirs; other;; other) dirs; other;;
rest) other;; rest) other;;
info) info;; info) info;;