dnote/pkg/server/assets/styles/build.sh
2022-04-23 13:17:38 +10:00

24 lines
388 B
Bash
Executable file

#!/usr/bin/env bash
# build.sh builds styles
set -ex
dir=$(dirname "${BASH_SOURCE[0]}")
serverDir="$dir/../.."
outputDir="$serverDir/static"
inputDir="$dir/src"
rm -rf "${outputDir:?}/*"
sass --version
task="sass \
--style compressed \
--source-map \
$inputDir:$outputDir"
# compile first then watch
eval "$task"
if [[ "$1" == "true" ]]; then
eval "$task --watch --poll"
fi