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 locations
DOTFILES_HOME_DIR="$(cd -P "$(dirname "$(readlink ~/.dotfilesrc)")" && pwd)" 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_ZSH_DIR="$DOTFILES_ROOT_DIR/zsh"
DOTFILES_BASH_DIR="$DOTFILES_ROOT_DIR/bash" DOTFILES_BASH_DIR="$DOTFILES_ROOT_DIR/bash"
DOTFILES_SHELL_DIR="$DOTFILES_ROOT_DIR/shell" DOTFILES_SHELL_DIR="$DOTFILES_ROOT_DIR/shell"

View file

@ -1,17 +1,19 @@
#!/bin/sh #!/bin/sh
[ $(pwd) = "$HOME/.dotfiles" ] || ln -sfn "$(pwd)" "$HOME/.dotfiles"
for file in home/*; do for file in home/*; do
dotfile="$(basename "$file")" dotfile="$(basename "$file")"
case "${dotfile}" in case "${dotfile}" in
Makefile|*.md|LICENSE|setup.sh) Makefile|*.md|LICENSE|setup.sh)
# NOOP : # NOOP
;; ;;
*) *)
if [ -d "${dotfile}" ]; then
:
else
# link the file with a leading dot # link the file with a leading dot
echo "linking ${dotfile}" echo "linking ${dotfile}"
ln -sf "$(pwd)/${file}" "$HOME/.${dotfile}" ln -sf "${PWD}/${file}" "$HOME/.${dotfile}"
fi
;; ;;
esac esac
done done