Update render.sh@>v3.3p4
Apparently sassc's flag is otherwise implicit.
This commit is contained in:
parent
850efd5950
commit
253b02e738
20
pfiles.rb
20
pfiles.rb
@ -1,4 +1,6 @@
|
|||||||
#!/usr/bin/ruby
|
#!/usr/bin/ruby
|
||||||
|
# pfiles.rb
|
||||||
|
# v1.0-p2
|
||||||
require 'find'
|
require 'find'
|
||||||
ignore=!File.file?('ignore.txt') ? [] : File.readlines('ignore.txt')
|
ignore=!File.file?('ignore.txt') ? [] : File.readlines('ignore.txt')
|
||||||
if ignore != []
|
if ignore != []
|
||||||
@ -26,26 +28,10 @@ when "doc"
|
|||||||
print ' ' unless i==l.last
|
print ' ' unless i==l.last
|
||||||
end
|
end
|
||||||
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"
|
when "sass"
|
||||||
for i in l do
|
for i in l do
|
||||||
next if ignore.include?(i)
|
next if ignore.include?(i)
|
||||||
if /\.sass$/.match?(i)
|
if /\.s[ac]ss$/.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)
|
|
||||||
print i
|
print i
|
||||||
print ' ' unless i==l.last
|
print ' ' unless i==l.last
|
||||||
end
|
end
|
||||||
|
29
render.sh
29
render.sh
@ -1,18 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# render.sh: part of the tape-and-string framework.
|
# render.sh: part of the tape-and-string framework.
|
||||||
# v3.3-p2
|
# v3.3-p4
|
||||||
#B: Load
|
#B: Load
|
||||||
enable -f /usr/lib/bash/csv csv
|
enable -f /usr/lib/bash/csv csv
|
||||||
declare -A title
|
declare -A title
|
||||||
#E: Load
|
#E: Load
|
||||||
#B: Definition
|
#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 inf { echo -e "\x1B[1;32mINF\x1B[0m: $*"; }
|
||||||
function wrn { echo -e "\x1B[1;93mWRN\x1B[0m: $*"; }
|
function wrn { echo -e "\x1B[1;93mWRN\x1B[0m: $*"; }
|
||||||
function err { echo -e "\x1B[1;31mERR\x1B[0m: $*"; }
|
function err { echo -e "\x1B[1;31mERR\x1B[0m: $*"; }
|
||||||
@ -67,30 +60,18 @@ function sass {
|
|||||||
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
|
return 1
|
||||||
fi
|
fi
|
||||||
local i o sass scss
|
local i o sass
|
||||||
sass=(`./pfiles.rb sass`)
|
sass=(`./pfiles.rb sass`)
|
||||||
scss=(`./pfiles.rb scss`)
|
|
||||||
inf "Rendering sass files..."
|
inf "Rendering sass files..."
|
||||||
if [ ${#sass[@]} -eq 0 ]; then
|
if [ ${#sass[@]} -eq 0 ]; then
|
||||||
inf "No .sass files detected, skipping"
|
inf "No .sass files detected, skipping"
|
||||||
unset sass
|
return 0
|
||||||
else
|
else
|
||||||
for i in ${sass[@]}; do
|
for i in ${sass[@]}; do
|
||||||
o="${i/in/out}"
|
o="${i/in/out}"
|
||||||
o="${o/.sa/.c}"
|
o="${o/.s[ac]/.c}"
|
||||||
echo "$i => $o"
|
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
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user