Skip to content

Move chdir to finally block - #1031

Open
balagan73 wants to merge 1 commit into
mainfrom
move-chdir-to-finally
Open

Move chdir to finally block#1031
balagan73 wants to merge 1 commit into
mainfrom
move-chdir-to-finally

Conversation

@balagan73

Copy link
Copy Markdown
Contributor

If Drupal bootstrapping threw an exception, the working directory would remain wherever Drupal had changed it, rather than being restored to the project root.

By moving chdir(DIR) into a finally block, the working directory is now guaranteed to be reset to the project root regardless of whether bootstrapping succeeds or fails. This matters because subsequent Robo commands rely on the CWD being the project root.

@balagan73
balagan73 requested review from AronNovak and amitaibu April 27, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants