This PR deletes directories created by the symlink and copy actions.
The following decisions have been made, but I'm open for input:
We only delete created directories if they are empty after having deleted all other created files and symlinks.
Created directories that couldn't be deleted, are still tracked by astrality, offering the ability to "retry" the cleanup action.
Users are instructed to manually delete files not created by astrality, before we are willing to delete such directories.
There is no way to override this safe behavior at the moment.
Warnings are printed to the terminal when this occurs.
Fixes #139
TODO:
[x] Support persistence of created directories in the persistence module.
[x] Don't delete directories that contain new files not created by the module.
[x] Actually persist created directories when they are created, using the capabilities introduced above.
[x] Support nested directory creations and deletions. Deletions are relatively simple, as we can traverse the created directories bottom-up, but now we need some way to find out exactly which directories are created on Pathlib.path.mkdir(parents=True).
Work for future PRs:
[ ] Hash created directories.
[ ] Use this capability for other actions, such as compile and stow.
This PR deletes directories created by the
symlink
andcopy
actions.The following decisions have been made, but I'm open for input:
Fixes #139
TODO:
persistence
module.Pathlib.path.mkdir(parents=True)
.Work for future PRs:
compile
andstow
.