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,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
;;
*)
if [ -d "${dotfile}" ]; then
:
else
# link the file with a leading dot
echo "linking ${dotfile}"
ln -sf "$(pwd)/${file}" "$HOME/.${dotfile}"
ln -sf "${PWD}/${file}" "$HOME/.${dotfile}"
fi
;;
esac
done