dotwryn/redirect
2019-12-02 10:16:05 -07:00

55 lines
1.8 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;
grep '.wryn' $HOME/.zshrc >/dev/null 2>/dev/null \
&& echo already set up zsh rc \
|| echo source $RC_DIR/zsh/rc >> $HOME/.zshrc;
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_ZSH_SETUP="$HOME/.my_zsh_env"
if [ ! -f "$LOCAL_ZSH_SETUP" ]; then
touch "$LOCAL_ZSH_SETUP";
echo '#!/bin/zsh' >> $LOCAL_ZSH_SETUP
echo 'RD_PATH="$HOME/RentDynamics";' >> $LOCAL_ZSH_SETUP
echo 'SCHOOL_ZSH="$HOME/School";' >> $LOCAL_ZSH_SETUP
echo 'DOTWRYN="$HOME/.wryn";' >> $LOCAL_ZSH_SETUP
else
echo 'zsh environment 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=expand("$HOME/.wryn")' >> $LOCAL_VIM_SETUP
echo 'let $VIM_DIR=expand("$RC_DIR/vim")' >> $LOCAL_VIM_SETUP
echo 'let $WRYNVIMRC=expand("$VIM_DIR/rc.vim")' >> $LOCAL_VIM_SETUP
echo 'let $WRYNBASH=expand("$RC_DIR/bashrc")' >> $LOCAL_VIM_SETUP
echo 'let $MYBASHRC=expand("$HOME/.bashrc")' >> $LOCAL_VIM_SETUP
echo 'let $WEBBROWSER="' $(which google-chrome-stable) '"' >> $LOCAL_VIM_SETUP
else
echo 'vim environment variables already set up'
fi