Created
April 7, 2023 16:46
-
-
Save Finkregh/20b0f616b9503204d9147b17f2a03e6c to your computer and use it in GitHub Desktop.
unlink dotfiles created by e.g. stow
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
# this expects your dotfiles in .dotfiles | |
for l in $( | |
for link in $(find . -type l); do | |
if readlink "$link" | grep -q ".dotfiles"; then | |
echo "$link" | |
fi | |
done | |
); do | |
echo /bin/cp --remove-destination "$(realpath "$l")" "$l" | |
done | tee symlinks-todo.sh | |
# then look at symlinks-todo.sh and if content is ok run it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment