Created
December 18, 2015 12:58
-
-
Save sandervd/c3b10dd2df19a403e924 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
drush() { | |
local git_root in_git local_drush | |
git_root=`git rev-parse --show-cdup 2>/dev/null` | |
in_git=$? | |
if [ $in_git = 0 ]; then | |
local_drush=$git_root"vendor/bin/drush" | |
if [ -e $local_drush ]; then | |
command $local_drush "$@" | |
return "$?" | |
fi | |
fi | |
command drush "$@" | |
} |
Can we make this without the git lookup? just traverse paths upwards?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice !