From 04770be267d79757426ace930b563e94210a35dc Mon Sep 17 00:00:00 2001 From: Manuel Amago Date: Wed, 10 Aug 2016 17:32:47 +0100 Subject: Add install script Creates home directory dot file symlinks to the repository files. --- install.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 install.sh (limited to 'install.sh') diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..7d1d2fe --- /dev/null +++ b/install.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Adapted from https://github.com/torvald/dotfiles + +# Create symlinks for all dotfiles +# Use -f to overwrite existing dotfiles + +DOTFILES=$(ls -1 -d $PWD/dot-*) + +LN_OPTS="-s" +if [[ "$1" == "-f" ]]; then + LN_OPTS="$LN_OPTS -f" +fi + +for DOTFILE in $DOTFILES; do + BASENAME=$(basename $DOTFILE) + TARGET="$HOME/${BASENAME/dot-/.}" + echo ln $LN_OPTS $DOTFILE $TARGET + ln $LN_OPTS $DOTFILE $TARGET +done + +exit $? -- cgit v1.2.1