From e51fe1fe2b67fd2409d08a2a0bca2f445c640a2e Mon Sep 17 00:00:00 2001 From: Gurkirat Singh Date: Wed, 23 Jun 2021 15:55:42 +0530 Subject: [PATCH] Abort upgrade if unsaved changes found in bashit directory (#1890) helper (improvement): added safeguard for unsaved changes --- lib/helpers.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/helpers.bash b/lib/helpers.bash index 7474f423..26956193 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -224,6 +224,9 @@ _bash-it-update-() { cd "${BASH_IT}" || return + DIFF=$(git diff --name-status) + [ -n "$DIFF" ] && echo -e "Local changes detected in bash-it directory. Clean '$BASH_IT' directory to proceed.\n$DIFF" && return 1 + if [ -z "$BASH_IT_REMOTE" ]; then BASH_IT_REMOTE="origin" fi