The Drush script starts out by staching the cdw into $ORIGDIR, doing some stuff in another directory, and then restoring the cwd via cd back to $ORIGDIR. The other operations are done via $(...), though, which executes in a subprocess that insulates changes to the cwd from the calling script. The script save/restore is therefore unnecessary.

Removing this also clears up the spurious error message Drush prints out should you ever do something like sudo chown -R root ., which causes Drush to complain that you can't change directories to the directory you're already in every time you execute a Drush command.

CommentFileSizeAuthor
drush-remove-dir-restore.patch641 bytesgreg.1.anderson

Comments

jhedstrom’s picture

Project: Drupal.org drush » Drush
Component: Code » Base system (internal API)

I think this landed in the wrong project queue.

greg.1.anderson’s picture

You are right! Thanks.

jonhattan’s picture

greg.1.anderson’s picture

Status: Needs review » Closed (duplicate)

Patch merged in to the other issue.