Created
August 31, 2015 06:45
-
-
Save yocontra/fd3a7abfd81ecf3349b8 to your computer and use it in GitHub Desktop.
how somebody compiles a folder of scss files using make and bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SCSS include path | |
BINPATH=`dirname $0` | |
STATIC_DIR="$BINPATH/../root/static/scss" | |
# SCSS | |
function compile_dir { | |
SCSS_DIR=$1 | |
SCSS=scss | |
PATH="$(ruby -rubygems -e 'puts Gem.user_dir')/bin:$PATH" | |
which $SCSS | |
if [[ $? == 1 ]]; then | |
# amazon linux/ubuntu | |
# i think | |
SCSS=/usr/local/bin/scss | |
if [[ ! -e "$SCSS" ]]; then | |
# centos? idk | |
SCSS=/var/lib/gems/1.8/bin/scss | |
if [[ ! -e "$SCSS" ]]; then | |
echo "scss compiler '$SCSS' not found" | |
exit 1 | |
fi | |
fi | |
fi | |
# compile | |
rm -rf .sass-cache | |
$SCSS -I "$STATIC_DIR" -t compressed --update "$SCSS_DIR" | |
} | |
compile_dir "$STATIC_DIR” |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment