by prettyscripts on 2009-07-31 11:18:00 • Leave a comment »
hen working on symfony-based projects, you need to regularly call the mighty symfony command, which does a lot of things.
however the command must be run from the project root. this is quite inconvenient. the files you’re working on might be somewhere the deep down the root and you need to keep cd back to the project directory. or you need to keep a separate window opened to run the command.
while browsing code snippets section, i found this useful article about running the command anywhere below the project root.
i'm using linux. the shell script version:
Code:
#!/bin/sh | |
| |
while [ 1 ]; do | |
if [ -f 'symfony' ]; then | |
symfony $* | |
exit $? | |
fi | |
| |
cd .. | |
if [ "$PWD" = "/" ]; then | |
echo 'cannot find symfony project directory' | |
exit 1 | |
fi | |
done |