You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that would be too dangerous to enable in general. Whilst a lot of Stow packages share top-level directories such as bin/, lib/, that wouldn't necessarily be a problem because we could make it avoid adopting folders which are already controlled by Stow. But it would often be a problem the first time any package was stowed into a given target directory, e.g. if ~/bin/ or /usr/local/bin already existed and contained files or directories which should not be adopted into the package being stowed.
Maybe we could allow this in carefully controlled circumstances, such as --adopt-folder=bin, but then how is that any better than just doing
mv $target_dir/bin $stow_package
before running a normal stow command? So I'm not convinced the benefits of implementing this outweigh the dangers. However I'm very willing to be persuaded otherwise, if you can give a concrete real-world example which explains your use case!
Borrowing from ideas in #24, maybe the benefits are worth it after all:
verify that the target_dir file is not a symlink (which needs to be smarter, it should actually check if it's a non-stow symlink)
verify that the stow_package contains the appropriate parent dirs (essentially mkdir -p $(dirname ...))
bail if the directory already exists in the package, rather than accidentally moving the new one from the target directory to underneath the existing one in the package tree.
So I think I'm now persuaded otherwise - pull requests very welcome!
Allow
stow --adopt
to adopt a folder if I try to stow a folder that already exists.The text was updated successfully, but these errors were encountered: