From 253b02e738d21ed8768516c89a860f780cea4e35 Mon Sep 17 00:00:00 2001 From: Atlas Cove Date: Sat, 11 Feb 2023 20:44:58 +0000 Subject: [PATCH] Update render.sh@>v3.3p4 Apparently sassc's flag is otherwise implicit. --- pfiles.rb | 20 +++----------------- render.sh | 29 +++++------------------------ 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/pfiles.rb b/pfiles.rb index 7d2149d..9b62bbd 100755 --- a/pfiles.rb +++ b/pfiles.rb @@ -1,4 +1,6 @@ #!/usr/bin/ruby +# pfiles.rb +# v1.0-p2 require 'find' ignore=!File.file?('ignore.txt') ? [] : File.readlines('ignore.txt') if ignore != [] @@ -26,26 +28,10 @@ when "doc" print ' ' unless i==l.last end end -when "scass" - for i in l do - next if ignore.include?(i) - if /\.s[ac]ss$/.match?(i) - print i - print ' ' unless i==l.last - end - end when "sass" for i in l do next if ignore.include?(i) - if /\.sass$/.match?(i) - print i - print ' ' unless i==l.last - end - end -when "scss" - for i in l do - next if ignore.include?(i) - if /\.scss$/.match?(i) + if /\.s[ac]ss$/.match?(i) print i print ' ' unless i==l.last end diff --git a/render.sh b/render.sh index 38ea5ad..a21f9dc 100755 --- a/render.sh +++ b/render.sh @@ -1,18 +1,11 @@ #!/bin/bash # render.sh: part of the tape-and-string framework. -# v3.3-p2 +# v3.3-p4 #B: Load enable -f /usr/lib/bash/csv csv declare -A title #E: Load #B: Definition - -function in_arr { - for i in "${@:2}"; do - [[ "$i" = "$1" ]] && return 0 - done - return 1 -} function inf { echo -e "\x1B[1;32mINF\x1B[0m: $*"; } function wrn { echo -e "\x1B[1;93mWRN\x1B[0m: $*"; } function err { echo -e "\x1B[1;31mERR\x1B[0m: $*"; } @@ -67,32 +60,20 @@ function sass { err "Cannot render, directory 'out' does not exist, run ./render.sh dir" return 1 fi - local i o sass scss + local i o sass sass=(`./pfiles.rb sass`) - scss=(`./pfiles.rb scss`) inf "Rendering sass files..." if [ ${#sass[@]} -eq 0 ]; then inf "No .sass files detected, skipping" - unset sass + return 0 else for i in ${sass[@]}; do o="${i/in/out}" - o="${o/.sa/.c}" + o="${o/.s[ac]/.c}" echo "$i => $o" - sassc -a $i $o + sassc -t expanded -a $i $o done fi - if [ ${#scss[@]} -eq 0 ]; then - inf "No .scss files detected, skipping." - unset scss - else - for i in ${scss[@]}; do - o="${i/in/out}" - o="${o/\.s/.}" - echo "$i => $o" - sassc $i $o - done - fi } function other { if ! test -d out; then