diff --git a/lib/self-upgrade.bash b/lib/self-upgrade.bash index ab5e553..3f93408 100644 --- a/lib/self-upgrade.bash +++ b/lib/self-upgrade.bash @@ -20,12 +20,17 @@ function development_upgrade { cd "$MIAOU_BASH_DIR"/ || return 12 # should not happen [[ -n "$(git status --porcelain)" ]] && - >&2 echo "ERROR: repository has uncommited changes" && + >&2 echo 'ERROR: repository has uncommited changes!' && builtin exit 12 - git pull - sudo_root - sudo miaou lib/initiate.bash + local git_output + git_output=$(git pull 2>&1) + if echo "$git_output" | grep -q 'up to date'; then + : # does nothing + else + sudo_root + sudo miaou lib/initiate.bash + fi } function system_upgrade {