commit 788d89687d8359735ccf1f00bee369733fc68d09 parent a1678d236f1911a4eda45de147dcb7b7342b7396 Author: Alex Balgavy <a.balgavy@gmail.com> Date: Tue, 21 Aug 2018 12:46:38 +0200 ln now uses h flag The holy trinity is -shf. That overwrites existing links, makes symlinks, and prevents directories from making symlinks inside themselves, leading to recursion in infinity (not what I currently want). Diffstat:
M | install.sh | | | 13 | ++++++++----- |
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/install.sh b/install.sh @@ -1,14 +1,17 @@ #!/bin/bash + for i in *; do case "$i" in "vim-config") - echo "ln -sf $(pwd)\"$i\" ~/.config/\"$i\"" - ln -sf $(pwd)/"$i" ~/.config/"$i" + echo "ln -shf $(pwd)\"$i\" ~/.config/\"$i\"" + ln -shf $(pwd)/"$i" ~/.config/"$i" + ;; + "exclude") ;; *) - echo "ln -sf $(pwd)/$i ~/.$i" - ln -sf $(pwd)/$i ~/.$i + echo "ln -shf $(pwd)/$i ~/.$i" + ln -shf $(pwd)/$i ~/.$i ;; esac done -ln -sf ~/.config/vim-config/init.vimrc ~/.vimrc +ln -shf ~/.config/vim-config/init.vimrc ~/.vimrc