Skip to content

Instantly share code, notes, and snippets.

@contra contra/scss.sh
Created Aug 31, 2015

Embed
What would you like to do?
how somebody compiles a folder of scss files using make and bash
#!/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
You can’t perform that action at this time.