diff --git a/check_for_update.sh b/check_for_update.sh index 60ed0bf..335019a 100755 --- a/check_for_update.sh +++ b/check_for_update.sh @@ -16,30 +16,30 @@ function _update_dotfiles_update() { function _upgrade_dotfiles() { (cd $DOTFILES; git pull -q --rebase && echo "Succesfully upgraded dotfiles" || echo "Could not upgrade dotfiles.") - # amix's vimrc update - amix_vimrc=$HOME/.vim_runtime - if [[ -d $amix_vimrc ]]; then - # the update_plugins.py script makes the vim_runtime dir dirty, so we have to reset --hard - (cd $amix_vimrc && git reset --hard HEAD >/dev/null && git pull -q --rebase && echo "Upgraded amix's vimrc" || echo "Could not upgrade amix's vimrc" >&2) - (python $amix_vimrc/update_plugins.py >/dev/null || echo "upgraded amix's vimrc's plugins || "echo "Could not upgrade amix's vimrc's plugins" >&2) - else - echo "Could not upgrade amix's vimrc and plugins (missing .vim_runtime folder)" >&2 - fi + # amix's vimrc update + amix_vimrc=$HOME/.vim_runtime + if [[ -d $amix_vimrc ]]; then + # the update_plugins.py script makes the vim_runtime dir dirty, so we have to reset --hard + (cd $amix_vimrc && git reset --hard HEAD >/dev/null && git pull -q --rebase && echo "Upgraded amix's vimrc" || echo "Could not upgrade amix's vimrc" >&2) + (python $amix_vimrc/update_plugins.py >/dev/null || echo "upgraded amix's vimrc's plugins || "echo "Could not upgrade amix's vimrc's plugins" >&2) + else + echo "Could not upgrade amix's vimrc and plugins (missing .vim_runtime folder)" >&2 + fi - # custom zsh plugins - custom_plugins=("alias-tips" "fast-syntax-highlighting" "zsh-autosuggestions") - for plugin in $custom_plugins; do - (cd $ZSH/custom/plugins/$plugin && git pull -q --rebase && echo "Upgraded oh-my-zsh plugin: $plugin" || echo "Could not upgrade oh-my-zsh plugin: $plugin" >&2) - done + # custom zsh plugins + custom_plugins=("alias-tips" "fast-syntax-highlighting" "zsh-autosuggestions") + for plugin in $custom_plugins; do + (cd $ZSH/custom/plugins/$plugin && git pull -q --rebase && echo "Upgraded oh-my-zsh plugin: $plugin" || echo "Could not upgrade oh-my-zsh plugin: $plugin" >&2) + done - # update the zsh file - _update_dotfiles_update + # update the zsh file + _update_dotfiles_update } epoch_target=$UPDATE_ZSH_DAYS if [[ -z "$epoch_target" ]]; then - # Default to old behavior - epoch_target=13 + # Default to old behavior + epoch_target=13 fi # Cancel upgrade if the current user doesn't have write permissions for the @@ -50,8 +50,8 @@ fi whence git >/dev/null || return 0 if mkdir "$DOTFILES/update.lock" 2>/dev/null; then - if [ -f ~/.dotfiles-update ]; then - . ~/.dotfiles-update + if [ -f ~/.dotfiles-update ]; then + . ~/.dotfiles-update if [[ -z "$LAST_EPOCH" ]]; then _update_dotfiles_update && return 0;