-
Notifications
You must be signed in to change notification settings - Fork 667
Make sure path exist before writing #4472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures the directory for a target file exists before writing and refactors the initial “create” step in _run_scenarios
to separate shared‐data handling.
- util.py: Add a call to create the parent directory before writing the file.
- base.py: Simplify the shared_data check, add a nested “create” condition, and update lint ignore.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/molecule/util.py | Ensure parent directory exists before writing file content |
src/molecule/command/base.py | Refactor initial scenario “create” logic and update lint flags |
Comments suppressed due to low confidence (1)
src/molecule/command/base.py:214
- This append should only occur if the subcommand actually ran; indent both this line and the
default.results = []
line under the nestedif "create" in ...
block to avoid appending or clearing results whencreate
wasn’t executed.
scenarios.results.append({"name": default.name, "results": default.results})
No description provided.