Repository navigation
fix uninstall deleting dotpath files through a symlinked directory - #497
Merged
deadc0de6 merged 1 commit intoNov 17, 2026
Merged
Conversation
A directory dotfile installed with link absolute/relative (or link_children) is a symlink to the dotpath. uninstall treated it as a directory and removed every file under it, which are the files in the dotpath, then the link. Remove the link itself instead.
Owner
|
thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dotdrop uninstalldeletes the dotfiles in the dotpath when a directory dotfile was installed as a link.Without
-fthe prompt asksRemove ~/.config/app/conf.ini?, which reads like the installed copy, but it is the file in the repo. Same withlink: relativeand withlink_children, where each child is a link.Uninstaller._removeand_descenduseos.path.isdir(), which is true for a symlink to a directory, so they descend into the link target (the dotpath) and remove every file there before removing the link. A symlink is now removed as a link.tests-ng/uninstall.shchecked that the dotpath directory still exists, but not its files; it now also checksdotfiles/y/fileanddotfiles/y/subdir/subfile, which fails without the change (absolute, relative and link_children). Unit tests pass; tests-ng: same results as on master here (import-with-trans.shneedstree,update.shalso fails on master in this environment). Ran the steps above: the repo file is kept and only the link is removed.