Skip to content

Instantly share code, notes, and snippets.

@issackelly
Created July 4, 2011 18:51
Show Gist options
  • Save issackelly/1063769 to your computer and use it in GitHub Desktop.
Save issackelly/1063769 to your computer and use it in GitHub Desktop.
Compass and CoffeeScript in Virtualenv
#!/bin/bash
# postactivate
# This hook is run after this virtualenv is activated.
cd ~/Projects/internal_kct/reb/
if [ "${OLDPATH}" == "" ]; then
echo "SETTING PATH"
export OLDPATH=$PATH
export PATH=$PATH:~/Projects/internal_kct/reb/bin/
fi
watch_coffee_sass
#!/bin/bash
# predeactivate
# This hook is run before this virtualenv is deactivated.
if [ "${OLDPATH}" != "" ]; then
echo "Resetting PATH"
export PATH=$OLDPATH
unset OLDPATH
fi
cd ~/Projects/internal_kct/reb
WATCHING=`cat logs/watching.pid`
if [ "${$}" == "${WATCHING}" ]; then
echo "KILLING coffee/sass"
kill `cat logs/coffee.pid`
kill `cat logs/compass.pid`
echo "" > logs/watching.pid
fi
unset WATCHING
#!/bin/bash
# watch_coffee_sass
cd ~/Projects/internal_kct/reb/
WORKING=`cat logs/watching.pid`
if [ "${WORKING}" == "" ]; then
echo "LAUNCHING WATCHERS"
echo $$ > logs/watching.pid
coffee -o reb_project/static/js/ -w reb_project/static/coffee/ >> logs/coffee.log &
PID=$!
echo $PID > logs/coffee.pid
compass watch reb_project/static >> logs/compass.log &
PID=$!
echo $PID > logs/compass.pid
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment