make now just calls sass builder

This commit is contained in:
shockrahwow 2019-11-13 19:03:19 -08:00
parent de35db1a9a
commit b3fb0b07e8
3 changed files with 21 additions and 29 deletions

View File

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

18
server/scripts/build-sass.sh Executable file
View File

@ -0,0 +1,18 @@
#!/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"
build() {
echo Building $1 css in $build_dir/$1.css
sass "$sass_dir/$1.scss" "$build_dir/$1.css"
}
# Build each thing because sass blows
for sf in $sass_dir/*;do
b=`basename $sf`
sass "$sf" "$build_dir/${b%.*}.css"
done

View File

@ -1,29 +0,0 @@
#!/bin/sh
build_dir="static/css"
sass_dir="static/sass"
if [ ! -d $build_dir ]; then
mkdir -p $build_dir
fi
login="login"
build() {
echo Building $1 css in $build_dir/$1.css
sass "$sass_dir/$1.scss" "$build_dir/$1.css"
}
_flags() {
echo '-b FILE : build css from sass'
}
if [ -z "$1" ];then
_flags
fi
while getopts ":b:" opt; do
case $opt in
b) build $2;;
esac
done