2015-07-26 20:27:32 +02:00
|
|
|
#!/usr/bin/env bash
|
2012-06-18 01:10:31 +02:00
|
|
|
#
|
|
|
|
# Pull in changes and make new symlinks
|
2014-05-23 17:01:28 +02:00
|
|
|
#
|
2012-06-18 01:10:31 +02:00
|
|
|
# adapted from @mathiasbynens & @michaeljsmalley
|
|
|
|
# https://github.com/mathiasbynens/dotfiles/blob/master/bootstrap.sh
|
|
|
|
# https://github.com/michaeljsmalley/dotfiles/blob/master/makesymlinks.sh
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
# list of files/folders to symlink in homedir
|
2019-06-08 02:42:18 +02:00
|
|
|
FILES="bash_aliases bashrc bash_profile bash_paths bash_prompt bash_exports editorconfig gitconfig gitignore hushlogin inputrc private bin tmux.conf vimrc"
|
2014-11-03 17:40:13 +01:00
|
|
|
|
2017-09-10 14:40:28 +02:00
|
|
|
for FILE in $FILES; do
|
2012-06-18 01:10:31 +02:00
|
|
|
|
2017-09-10 14:40:28 +02:00
|
|
|
# remove old symlinks if present
|
|
|
|
if [ -h "$HOME/.$FILE" ]; then
|
|
|
|
rm "$HOME/.$FILE"
|
|
|
|
echo "$(tput setaf 64)✓$(tput sgr0) Removed old symlink to $(tput setaf 37)$FILE$(tput sgr0)"
|
|
|
|
fi
|
2016-11-03 22:22:31 +01:00
|
|
|
|
2017-09-10 14:40:28 +02:00
|
|
|
# symlink files
|
|
|
|
ln -s "$PWD/$FILE" "$HOME/.$FILE"
|
|
|
|
echo "$(tput setaf 64)✓$(tput sgr0) Created new symlink to $(tput setaf 37)$FILE$(tput sgr0)"
|
2014-11-03 17:40:13 +01:00
|
|
|
|
2012-06-18 01:10:31 +02:00
|
|
|
done
|
|
|
|
|
2014-11-03 17:40:13 +01:00
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
# source what we just created
|
|
|
|
# ----------------------------------------------------------------------
|
|
|
|
|
2017-09-10 14:40:28 +02:00
|
|
|
# shellcheck source=/dev/null
|
|
|
|
source "$HOME/.bash_profile"
|
2017-05-07 01:20:00 +02:00
|
|
|
|
|
|
|
exit
|