From: James Bunton Date: Wed, 7 Feb 2024 01:35:18 +0000 (+1100) Subject: install.sh X-Git-Url: https://code.delx.au/dotfiles/commitdiff_plain/250a450007b09e6e18c8bd48ac35e5958107924f?ds=sidebyside install.sh --- diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..6965fe5 --- /dev/null +++ b/install.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +set -eu + +cd "$HOME" + +FILES=( + .bash_logout + .profile + .bash_profile + .bashrc + .gitconfig + .git-hooks-global + .gitignore-global + .inputrc + .pythonrc.py + .screenrc + .vimrc +) + +if ! [ -d .dotfiles ]; then + git clone https://code.delx.au/dotfiles .dotfiles +fi + +echo 'Removing...' +for f in "${FILES[@]}"; do + rm -f "$f" && echo " $f" +done + +echo 'Installing...' +for f in "${FILES[@]}"; do + if [ -f "${HOME}/.dotfiles/$f" ]; then + echo " $f" + ln -s "${HOME}/.dotfiles/$f" + fi +done + +echo 'Done!'