diff --git a/install.sh b/install.sh index 5e175b7..815a251 100755 --- a/install.sh +++ b/install.sh @@ -55,6 +55,15 @@ check_oh-my-zsh () { # Check whether linux or macos is used check_os +# check if .oh-my-zsh is installed - install if not, update if it is installed. +check_oh-my-zsh +inst=$? +if [ $inst == 3 ]; then + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended +else + git -C ~/.oh-my-zsh/ pull +fi + # Backup dotfiles and link to local versions for file in $(find ~/dotfiles -maxdepth 1 -name ".*" ! -name ".aliases*" ! -name ".zshrc*" ! -name ".zcompdum*" ! -name ".*history*" -type f -printf "%f\n" ); do check_exist $file @@ -76,15 +85,6 @@ do fi done -# check if .oh-my-zsh is installed - install if not, update if it is installed. -check_oh-my-zsh -inst=$? -if [ $inst == 3 ]; then - sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended -else - git -C ~/.oh-my-zsh/ pull -fi - # link the .zshrc-file in home-directory depending on the underlying os if [ $os == linux ];then ln -s ~/dotfiles/.zshrc-linux ~/.zshrc