Skip to content

Conversation

@matsl
Copy link
Collaborator

@matsl matsl commented Oct 17, 2025

What

Add safer method to remove hywiki-folder.

Why

There is a small risk that the deletion of a test hywiki-directory
could touch a users real hywiki-directory. This PR creates a function
in hywiki-tests that eliminates this.

It works like this:

  • The cache file is checked if it is the only file in the
    directory. If it is, it is removed.
  • The whole folder is then removed. This step only works if the
    directory is empty and is ensured by delete-directory that does not
    delete directories with files.

Bonus is that hy-delete-dir-and-buffer now is reverted to its original
and does not know anything about hywiki caches.

@matsl matsl requested a review from rswgnu October 17, 2025 23:02
@matsl matsl mentioned this pull request Oct 17, 2025
@matsl matsl force-pushed the more_secure_removal_of_hywiki_directory branch from 3d3d61e to 8d07159 Compare October 18, 2025 08:05
The new tests were using the old way to remove the hywiki-directory
that was introduced in PR just merged.
@matsl matsl merged commit 0b829ed into master Oct 18, 2025
4 checks passed
@matsl matsl deleted the more_secure_removal_of_hywiki_directory branch October 18, 2025 08:21
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.

3 participants