Clean setup

This commit is contained in:
Loic Nageleisen 2021-12-01 00:36:33 +01:00
parent 54e03df8a6
commit fefe99ae9f
Signed by: lloeki
GPG key ID: 971B4D9F125CD31E
2 changed files with 9 additions and 7 deletions

View file

@ -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"

View file

@ -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