Abort upgrade if unsaved changes found in bashit directory (#1890)

helper (improvement): added safeguard for unsaved changes
pull/1901/head
Gurkirat Singh 2021-06-23 15:55:42 +05:30 committed by GitHub
parent d979c32c8a
commit e51fe1fe2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -224,6 +224,9 @@ _bash-it-update-() {
cd "${BASH_IT}" || return 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 if [ -z "$BASH_IT_REMOTE" ]; then
BASH_IT_REMOTE="origin" BASH_IT_REMOTE="origin"
fi fi