call symfony command anywhere

by prettyscripts on 2009-07-31 11:18:00 • Leave a comment »

symfony

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

Tags: command, symfony

No feedback yet

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
note: all comments are moderated. do not spam and do not advertise. any irrelevant and non-sense comments will be deleted.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)