dotwryn/redirect
2019-09-26 10:14:06 -06:00

37 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
RC_DIR='$HOME/.wryn'
[ ! -f "$HOME/.bashrc" ] && touch "$HOME/.bashrc";
[ ! -f "$HOME/.vimrc" ] && touch "$HOME/.vimrc";
grep '.wryn' $HOME/.bashrc >/dev/null 2>/dev/null \
&& echo already set up bash rc \
|| echo source $RC_DIR/bash/rc >> $HOME/.bashrc;
grep '.wryn' $HOME/.vimrc >/dev/null 2>/dev/null \
&& echo already set up vim rc \
|| echo source $RC_DIR/vim/rc.vim >> $HOME/.vimrc;
LOCAL_DIR_SETUP="$HOME/.my_bash_env"
if [ ! -f "$LOCAL_DIR_SETUP" ]; then
touch "$LOCAL_DIR_SETUP";
echo '#!/bin/bash' >> $LOCAL_DIR_SETUP
echo 'RD_PATH="$HOME/RentDynamics";' >> $LOCAL_DIR_SETUP
echo 'SCHOOL_DIR="$HOME/School";' >> $LOCAL_DIR_SETUP
echo 'DOTWRYN="$HOME/.wryn";' >> $LOCAL_DIR_SETUP
else
echo 'bash environment variables already set up'
fi
LOCAL_VIM_SETUP="$HOME/.my_vim_env"
if [ ! -f "$LOCAL_VIM_SETUP" ]; then
touch "$LOCAL_VIM_SETUP";
echo 'let $RC_DIR="$HOME/.wryn"' >> $LOCAL_VIM_SETUP
echo 'let $VIM_DIR="$RC_DIR/vim"' >> $LOCAL_VIM_SETUP
echo 'let $WRYNVIMRC="$VIM_DIR/rc.vim"' >> $LOCAL_VIM_SETUP
echo 'let $WRYNBASH="$RC_DIR/bashrc"' >> $LOCAL_VIM_SETUP
echo 'let $MYBASHRC="$HOME/.bashrc"' >> $LOCAL_VIM_SETUP
else
echo 'vim environment variables already set up'
fi