mirror of
https://github.com/jgthms/bulma.git
synced 2024-12-12 13:28:30 +00:00
46 lines
579 B
Bash
Executable File
46 lines
579 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# CONSTANTS
|
|
|
|
TEST_DIR=$(dirname $BASH_SOURCE)
|
|
FILES=$TEST_DIR/sass/*
|
|
CSS_DIR=$TEST_DIR/css
|
|
SASS_OPTIONS=--sourcemap=none
|
|
|
|
# FUNCTIONS
|
|
|
|
build_sass()
|
|
{
|
|
echo "Processing $1 file…"
|
|
|
|
local fileName=$(basename -- "$1")
|
|
local name="${fileName%.*}"
|
|
local destFile="$CSS_DIR/$name.css"
|
|
|
|
sass "$1" "${destFile}"
|
|
}
|
|
|
|
run_it()
|
|
{
|
|
rm -r $CSS_DIR
|
|
|
|
if [ ! -d "${CSS_DIR}" ]; then
|
|
echo "Creating $CSS_DIR directory…"
|
|
mkdir -p "${CSS_DIR}"
|
|
fi
|
|
|
|
if [ $1 ]
|
|
then
|
|
build_sass $1
|
|
else
|
|
for f in $FILES
|
|
do
|
|
build_sass $f
|
|
done
|
|
fi
|
|
}
|
|
|
|
# EXECUTION
|
|
|
|
run_it $@
|