Commit 2e8205dd authored by anarcat's avatar anarcat

try to upgrade drush even if it's the path

we rely on readlink -f, which is not really cross-platform, but the
alternative is not supporting symlinks properly...
parent 329c5bd7
......@@ -20,7 +20,14 @@ DRUSH_DIR=$HOME/drush
if which drush 2> /dev/null > /dev/null && which drush | grep -v 'no drush in' > /dev/null; then
msg "Drush is in the path, good"
# we do not set DRUSH to `which drush` because we're not sure how 'which' will behave
DRUSH_DIR=`which drush`
# yes, this will fail on non-GNU readlink, but we don't care - it
# just means drush won't be upgraded if it's the path on those
# platforms
DRUSH_DIR=`readlink -f $DRUSH_DIR`
elif [ -x $DRUSH ] ; then
msg "Drush found in $DRUSH, good"
......@@ -106,7 +113,7 @@ The version of Drush will be $DRUSH_VERSION
The version of Drush Make will be $DRUSH_MAKE_VERSION
echo "Drush will not be upgraded as the directory is not writable: $DRUSH_DIR"
echo "Drush will not be upgraded as its directory is not writable: $DRUSH_DIR"
if prompt_yes_no "Do you want to proceed with the upgrade?" ; then
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment