2016-10-16 07:41:03 -05:00
|
|
|
#!/bin/bash
|
|
|
|
# inspiration from https://github.com/webpro/dotfiles/blob/master/install.sh
|
|
|
|
# inspiration from https://medium.com/@webprolific/getting-started-with-dotfiles-43c3602fd789#.jfhvg130r
|
|
|
|
|
2017-09-17 04:51:13 -05:00
|
|
|
# PS1 COLOR
|
|
|
|
GREEN="\[\e[32m\]\u\[\e[m\]@\H\[\e[36m\][\[\e[m\]\[\e[33m\]\w\[\e[m\]\[\e[36m\]]\[\e[m\]:"
|
|
|
|
RED=""\[\e[31m\]\u\[\e[m\]@\H\[\e[36m\][\[\e[m\]\[\e[33m\]\w\[\e[m\]\[\e[36m\]]\[\e[m\]:"
|
|
|
|
|
2016-10-16 07:41:03 -05:00
|
|
|
# get current dir so script can run from anywhere
|
|
|
|
export DOTFILES_DIR
|
|
|
|
DOTFILES_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
2017-09-17 04:51:13 -05:00
|
|
|
|
2016-10-16 07:41:03 -05:00
|
|
|
# update dot files by pulling latest repo
|
|
|
|
[ -d "$DOTFILES_DIR/.git" ] && git --work-tree="$DOTFILES_DIR" --git-dir="$DOTFILES_DIR/.git" pull origin master
|
|
|
|
|
2017-09-17 04:51:13 -05:00
|
|
|
# run checks for color
|
|
|
|
if [[ $1 = "color=green" ]]; then
|
|
|
|
echo "export PS1=$GREEN" >> "$DOTFILES_DIR/.envars"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $1 = "color=red" ]; then
|
|
|
|
echo "export PS1=$RED" >> "$DOTFILES_DIR/.envars"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2016-10-16 07:41:03 -05:00
|
|
|
# symlink our dotfiles to our users home dir so they can make use of all the good stuff in it
|
|
|
|
ln -sfv "$DOTFILES_DIR/.bash_profile" ~
|
|
|
|
ln -sfv "$DOTFILES_DIR/.bashrc" ~
|
2016-10-17 03:18:20 -05:00
|
|
|
ln -sfv "$DOTFILES_DIR/.bash_aliases" ~
|
|
|
|
ln -sfv "$DOTFILES_DIR/.bash_functions" ~
|
2017-09-17 04:51:13 -05:00
|
|
|
|
2017-08-10 03:35:06 -04:00
|
|
|
ln -sfv "$DOTFILES_DIR/.envars" ~
|
2017-09-06 22:45:34 -05:00
|
|
|
|
|
|
|
ln -sfv "$DOTFILES_DIR/.vim" ~
|
|
|
|
ln -sfv "$DOTFILES_DIR/.vimrc" ~
|
2017-09-17 04:51:13 -05:00
|
|
|
|
|
|
|
# download and install vundle for vim plugins
|
|
|
|
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
|
|
|
|
|
|
|
|
|