Skip to content

Instantly share code, notes, and snippets.

@masnun
Created August 8, 2012 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masnun/3295463 to your computer and use it in GitHub Desktop.
Save masnun/3295463 to your computer and use it in GitHub Desktop.
Symfony command line tool shortcut
#!/bin/bash
# Expand globs to null when there are no matches
shopt -s nullglob
# Look for either a '<subdir>/console' or a 'symfony' file
until
file=(*/console symfony); [[ -f "$file" ]] && php "$file" "$@" && exit;
do
[[ "$PWD" == "/" ]] && break;
cd ..
done
echo 'No Symfony file could be found!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment