Skip to content
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

clean: fix handling of files from *_copied.json #331

Merged
merged 3 commits into from
Aug 23, 2024
Merged

clean: fix handling of files from *_copied.json #331

merged 3 commits into from
Aug 23, 2024

Conversation

kyleam
Copy link
Collaborator

@kyleam kyleam commented Aug 21, 2024

This PR fixes an issue I noticed when working on the clean examples for gh-329.


kyleam added 3 commits August 21, 2024 15:16
If the --copiedRuns argument is used, clean grabs the files to remove
from the *_copied.json file set up when a run uses --copy_lvl.
*_copied.json records the files as absolute paths.

clean doesn't process absolute paths correctly because it
unconditionally prepends a directory, leading to an invalid path.  As
a result, the files don't get removed.

Update clean to only append dir if the file isn't an absolute path.
clean ignores errors because it doesn't want to halt the process.
However, silently dropping the error makes it hard to catch issues
like the one fixed by the previous commit.
The repeated entries in extrapolateCopyFilesFromExtensions lead to the
*_copied.json files listing the file twice.  As a result, 'clean
--copiedRuns ...` tries to remove the file twice, leading to a failure
(converted to a logged message as of the last commit, and silently
dropped before that).
@kyleam kyleam requested a review from seth127 August 21, 2024 19:26
Base automatically changed from lint-fixes to main August 23, 2024 15:35
Copy link
Collaborator

@seth127 seth127 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup (of the cleanup function)

@kyleam kyleam merged commit b182773 into main Aug 23, 2024
4 checks passed
@kyleam kyleam deleted the clean-fix branch August 23, 2024 15:47
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