Created
August 1, 2012 15:25
-
-
Save kmdm/3227794 to your computer and use it in GitHub Desktop.
Shortcut to running app/console from any subdirectory of your symfony2 app (name: sc, place in $PATH)
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 | |
PHP=`which php` | |
EDITOR=`which editor` | |
while [ ! -f app/console ]; do | |
cd .. | |
if [ "$PWD" == "/" ]; then | |
break | |
fi | |
done | |
if [ "$1" == "-e" ]; then | |
if [ -f app/config/$2 ]; then | |
$EDITOR app/config/$2 | |
else | |
echo "unknown config file: $2" | |
fi | |
elif [ -f app/console ]; then | |
$PHP app/console $@ | |
else | |
echo "app/console: not found - are you in a symfony2 directory!?" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment