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.
| Comment | File | Size | Author |
|---|---|---|---|
| drush-remove-dir-restore.patch | 641 bytes | greg.1.anderson |
Comments
Comment #1
jhedstromI think this landed in the wrong project queue.
Comment #2
greg.1.anderson commentedYou are right! Thanks.
Comment #3
jonhattanThe usage of $() seems problematic in some scenarios. See #820870: Make drush script more compatible with non-POSIX shells [ORIGDIR=$' unexpected]
Comment #4
greg.1.anderson commentedPatch merged in to the other issue.