commit eae9d41c939542d144527ffa365266f45f0e1947 parent c7a3f2766e59c15522e68939bfa82ea2e36b1a0b Author: Anders Damsgaard <andersd@riseup.net> Date: Fri, 6 Oct 2017 15:31:29 -0400 better handling with existing symlinks Diffstat:
M | init/10_symlinks.sh | | | 27 | +++++++++++++++------------ |
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/init/10_symlinks.sh b/init/10_symlinks.sh @@ -6,19 +6,23 @@ mkdir -p ~/.ipython/profile_default mkdir -p ~/.mutt/cache chmod 0700 ~/.mutt/cache mkdir -p ~/tmp -mkdir -p ~/texmf/bibtex/bib/myfiles/ +mkdir -p $(kpsexpand '$TEXMFHOME')/bibtex/bib/myfiles/ # Symlink directories from iCloud drive to home if [ "$(uname)" = "Darwin" ]; then - ln -s ~/Library/Mobile\ Documents/com\~apple\~CloudDocs ~/iCloud - ln -s ~/iCloud/articles ~/articles - ln -s ~/iCloud/articles/own/BIBnew.bib ~/texmf/bibtex/bib/myfiles/BIB.bib - ln -s ~/iCloud/src ~/src - ln -s ~/iCloud/doc ~/doc - ln -s ~/doc/.password-store ~/.password-store - ln -s ~/iCloud/uni ~/uni - ln -s ~/iCloud/videos ~/videos - ln -s ~/Library/Mobile\ Documents/27N4MQEA55~pro~writer/Documents/ ~/iawriter + ln -shvf ~/Library/Mobile\ Documents/com\~apple\~CloudDocs \ + ~/iCloud + ln -shvf ~/iCloud/articles ~/articles + ln -shvf ~/iCloud/articles/own/BIBnew.bib \ + $(kpsexpand '$TEXMFHOME')/bibtex/bib/myfiles/BIB.bib + ln -shvf ~/iCloud/src ~/src + ln -shvf ~/iCloud/doc ~/doc + ln -shvf ~/doc/.password-store ~/.password-store + ln -shvf ~/iCloud/uni ~/uni + ln -shvf ~/iCloud/videos ~/videos + ln -shvf \ + ~/Library/Mobile\ Documents/27N4MQEA55~pro~writer/Documents/ \ + ~/iawriter fi shopt -s dotglob @@ -48,6 +52,5 @@ for f in links/*; do # Remove old symlinks [ -L $TARGET ] && rm $TARGET - echo "Symlink: $SOURCE -> $TARGET" - ln -s $SOURCE $TARGET + ln -sv $SOURCE $TARGET done