From f0061064a4a6f3968ff033f22816bc949261cea7 Mon Sep 17 00:00:00 2001 From: Austen Date: Fri, 13 Jun 2014 14:27:12 -0400 Subject: [PATCH] Attempted fix of sync.sh flags (untested) --- sync.sh | 73 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 25 deletions(-) diff --git a/sync.sh b/sync.sh index 48df79f..b03105a 100755 --- a/sync.sh +++ b/sync.sh @@ -1,37 +1,45 @@ -while getopts :b:o:t:ds option +#Install server applications +while getopts :s option do case "$option" in - b) - if [ -f ~/.vim/bundle/vundle/ ] - then - echo "Installing vundle" - git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle - fi - vim +BundleInstall +qa - ;; - t) - trash ~/.tmux.conf - ln -s ${PWD}/tmux.conf ~/.tmux.conf - ;; - d) - #Install desktop applications - echo "Preparing desktop installation" - sudo apt-get update;sudo apt-get upgrade;sudo apt-get install $(grep -vE "^\s*#" desktop.txt | tr "\n" " ") - ;; s) - #Install server applications echo "Preparing server installation" sudo apt-get update;sudo apt-get upgrade;sudo apt-get install $(grep -vE "^\s*#" server.txt | tr "\n" " ") ;; - o) - exit 0 - ;; - *) - echo "Flag not found" + esac +done +#Install desktop applications +while getopts :d option +do + case "$option" in + d) + echo "Installing desktop applications" + sudo apt-get update;sudo apt-get upgrade;sudo apt-get install $(grep -vE "^\s*#" desktop.txt | tr "\n" " ") ;; esac done -trash ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.gitignore_global ~/.bashrc ~/.bash_aliases ~/.bash_functions +#Tmux sync +while getopts :t option +do + case "$option" in + t) + echo "Syncing tmux" + trash ~/.tmux.conf + ln -s ${PWD}/tmux.conf ~/.tmux.conf + ;; + esac +done +#Quit if -o is called +while getopts :o option +do + case "$option" in + o) + echo "Exiting" + exit 0 + ;; + esac +done +rm ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.gitignore_global ~/.bashrc ~/.bash_aliases ~/.bash_functions ln -s ${PWD}/gitignore_global ~/.gitignore_global ln -s ${PWD}/vimrc ~/.vimrc ln -s ${PWD}/vimperatorrc ~/.vimperatorrc @@ -64,3 +72,18 @@ then echo "Installing sessionman in ~/.vim/plugin/" wget -O ~/.vim/plugin/sessionman.vim http://www.vim.org/scripts/download_script.php?src_id=15599 fi +#Install vim bundles +while getopts :b option +do + case "$option" in + b) + if [ -f ~/.vim/bundle/vundle/ ] + then + echo "Installing vundle" + git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle + fi + vim +BundleInstall +qa + ;; + esac +done +echo "Done syncing"