From fefe99ae9f4345783aab326f115fed34ae48702b Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Wed, 1 Dec 2021 00:36:33 +0100 Subject: [PATCH] Clean setup --- home/dotfilesrc | 2 +- setup.sh | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/home/dotfilesrc b/home/dotfilesrc index 2652706..5579fb7 100644 --- a/home/dotfilesrc +++ b/home/dotfilesrc @@ -1,6 +1,6 @@ # dotfiles locations DOTFILES_HOME_DIR="$(cd -P "$(dirname "$(readlink ~/.dotfilesrc)")" && pwd)" -DOTFILES_ROOT_DIR="$( dirname "$DOTFILES_HOME_DIR" )" +DOTFILES_ROOT_DIR="$(dirname "$DOTFILES_HOME_DIR")" DOTFILES_ZSH_DIR="$DOTFILES_ROOT_DIR/zsh" DOTFILES_BASH_DIR="$DOTFILES_ROOT_DIR/bash" DOTFILES_SHELL_DIR="$DOTFILES_ROOT_DIR/shell" diff --git a/setup.sh b/setup.sh index f779b22..e8ef87c 100755 --- a/setup.sh +++ b/setup.sh @@ -1,17 +1,19 @@ #!/bin/sh -[ $(pwd) = "$HOME/.dotfiles" ] || ln -sfn "$(pwd)" "$HOME/.dotfiles" - for file in home/*; do dotfile="$(basename "$file")" case "${dotfile}" in Makefile|*.md|LICENSE|setup.sh) - # NOOP + : # NOOP ;; *) - # link the file with a leading dot - echo "linking ${dotfile}" - ln -sf "$(pwd)/${file}" "$HOME/.${dotfile}" + if [ -d "${dotfile}" ]; then + : + else + # link the file with a leading dot + echo "linking ${dotfile}" + ln -sf "${PWD}/${file}" "$HOME/.${dotfile}" + fi ;; esac done