Skip to content

Instantly share code, notes, and snippets.

@kmdm
Created August 1, 2012 15:25
Show Gist options
  • Save kmdm/3227794 to your computer and use it in GitHub Desktop.
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)
#!/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