Last active
August 29, 2015 13:56
-
-
Save lyrixx/9119289 to your computer and use it in GitHub Desktop.
Refresh assetic on any modification
This file contains 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 | |
BASE_PATH=`dirname $0`/.. | |
ASSETS_PATH=$BASE_PATH/app/Resources/assets | |
ASSETS_PATH2=$BASE_PATH/src/SensioLabs/Bundle/InsightAnalysisBundle/Resources/public | |
if [[ `which inotifywait` ]]; then | |
while true; do | |
inotifywait -r -e modify -e move -e create -e delete $ASSETS_PATH/ $ASSETS_PATH2/ | while read line; do | |
php $BASE_PATH/app/console assetic:dump --force | |
done | |
done | |
elif [[ `which fswatch` ]]; then | |
fswatch -L -r -e '.*\/\..*' $ASSETS_PATH $ASSETS_PATH2 | while read line; do | |
php $BASE_PATH/app/console assetic:dump --force | |
done | |
else | |
NOCOLOR='\e[0m' | |
REDCOLOR='\e[37;41m' | |
echo -e "$REDCOLOR You must install one of 'inotifywait' or 'fswatch'.$NOCOLOR" | |
echo "" | |
echo ' # apt-get install inotify-tools' | |
echo ' # brew install fswatch' | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment