Replaced -o flag with -c flag to only sync config files if -c is passed

This commit is contained in:
Austen Adler 2014-06-16 23:33:58 -04:00
parent cdc43ca60f
commit 7a6b5633d0

23
sync.sh
View File

@ -1,13 +1,5 @@
rm ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.gitignore_global ~/.bashrc while getopts ":bsdtc" VALUE "$@"; do
ln -s ${PWD}/gitignore_global ~/.gitignore_global
ln -s ${PWD}/vimrc ~/.vimrc
ln -s ${PWD}/vimperatorrc ~/.vimperatorrc
ln -s ${PWD}/gitconfig ~/.gitconfig
ln -s ${PWD}/bashrc ~/.bashrc
while getopts ":bsdto" VALUE "$@"; do
echo "Processing flag: $VALUE"
if [ "$VALUE" = "b" ] ; then if [ "$VALUE" = "b" ] ; then
#Install vim bundles
mkdir -p ~/.vim/plugin/ mkdir -p ~/.vim/plugin/
mkdir -p ~/.vim/backup/ mkdir -p ~/.vim/backup/
mkdir -p ~/.vim/undo/ mkdir -p ~/.vim/undo/
@ -39,12 +31,17 @@ while getopts ":bsdto" VALUE "$@"; do
fi fi
if [ "$VALUE" = "t" ] ; then if [ "$VALUE" = "t" ] ; then
echo "Syncing tmux" echo "Syncing tmux"
trash ~/.tmux.conf rm ~/.tmux.conf
ln -s ${PWD}/tmux.conf ~/.tmux.conf ln -s ${PWD}/tmux.conf ~/.tmux.conf
fi fi
if [ "$VALUE" = "o" ] ; then if [ "$VALUE" = "c" ] ; then
echo "Exiting because of -o flag" echo "Syncing config files"
exit 0 rm ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.gitignore_global ~/.bashrc
ln -s ${PWD}/gitignore_global ~/.gitignore_global
ln -s ${PWD}/vimrc ~/.vimrc
ln -s ${PWD}/vimperatorrc ~/.vimperatorrc
ln -s ${PWD}/gitconfig ~/.gitconfig
ln -s ${PWD}/bashrc ~/.bashrc
fi fi
done done
echo "Done syncing" echo "Done syncing"