Skip to content

Instantly share code, notes, and snippets.

@d3orn
Created November 18, 2014 13:39
Show Gist options
  • Save d3orn/a129d409c16ff42e6ede to your computer and use it in GitHub Desktop.
Save d3orn/a129d409c16ff42e6ede to your computer and use it in GitHub Desktop.
#!/bin/bash
type -P compass &>/dev/null || { echo "Compass command not found."; exit 1; }
type -P coffee &>/dev/null || { echo "Coffee command not found."; exit 1; }
# Get current directory (project path)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SASS_DIR="$DIR/public/stylesheets/sass/"
CSS_DIR="$DIR/public/stylesheets/"
CS_DIR="$DIR/public/coffeescripts/"
JS_DIR="$DIR/public/javascripts/"
if [ ! -d "$SASS_DIR" ] || [ ! -d "$CS_DIR" ]
then
echo "Project not setup correctly! Put sass files in "$SASS_DIR" and coffee in "$CS_DIR""
else
if [ ! -d "$CSS_DIR" ]
then
mkdir "$CSS_DIR"
fi
if [ ! -d "$JS_DIR" ]
then
mkdir "$JS_DIR"
fi
echo "Watching changes in "$SASS_DIR" and "$CS_DIR" and compiling to "$CSS_DIR" and "$JS_DIR" respectively..."
`compass watch "$DIR"` &
`coffee -o "$JS_DIR" -cwl "$CS_DIR"` &
wait
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment