basically just copied frontends sass build script

This commit is contained in:
shockrahwow 2019-11-27 21:37:14 -08:00
parent 780e8b26bb
commit 080f76f15d
2 changed files with 16 additions and 14 deletions

View File

@ -2,8 +2,8 @@ BUILD=cargo build
build:
$(BUILD)
css:
sh scripts/build-sass.sh
sass:
sh scripts/build-sass.sh build
test:
cargo test

View File

@ -1,18 +1,20 @@
#!/bin/sh
# This script is intended to be called by make ngl
# Building all the ass because this is a massive fucking pain in make
build_dir="static/css"
sass_dir="static/sass"
sassDir='src/sass/'
cssDir='src/css/'
build() {
echo Building $1 css in $build_dir/$1.css
sass "$sass_dir/$1.scss" "$build_dir/$1.css"
for i in $sassDir/*;do
sass $i $cssDir/`basename -s .scss $i`.css
done
}
# Build each thing because sass blows
for sf in $sass_dir/*;do
b=`basename $sf`
sass "$sf" "$build_dir/${b%.*}.css"
watch() {
pairs=''
for i in $sassDir*;do
pairs="$i:$cssDir`basename -s .scss $i`.css $pairs"
done
sass --watch $pairs
}
"$@"