Skip to content

Instantly share code, notes, and snippets.

@yocontra
Created August 31, 2015 06:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yocontra/fd3a7abfd81ecf3349b8 to your computer and use it in GitHub Desktop.
Save yocontra/fd3a7abfd81ecf3349b8 to your computer and use it in GitHub Desktop.
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