It throws a warning every time you do so, and I believe it will actually fail if:

1) the current directory is the path to the Drupal install you are using it on
2) this path has spaces in
3) you haven't specified the path in the arguments
4) the script has to resolve symlinks (and those will cd away from the current directory)

I don't fully understand what makes condition 4 happen so I haven't tested this properly, but my attached patch gets rid of the warning for me and I'm confident should have no side-effects.

Example:
james@james-desktop:~/Desktop/path with spaces$ drush -r /var/www/website -y cron
/usr/bin/drush: line 22: cd: /home/james/Desktop/path: No such file or directory
Cron run successfully.

Expected output:
james@james-desktop:~/Desktop/path with spaces$ drush -r /var/www/website -y cron
Cron run successfully.

Steps to reproduce:
CD to a path that has spaces in it somewhere and invoke any drush command you feel like (including drush with no arguments). You will see the "No such file or directory" message as well as the expected output.

Fix:
Included in patch

CommentFileSizeAuthor
drush-wrapper-cwd-spaces-fix.diff40 bytesZoFreX

Comments

owen barton’s picture

Status: Needs review » Fixed

Committed - thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.