Skip to content

Commit

Permalink
Error cleanly if gitstatus.plugin.sh is not found in BASH_SOURCE
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Jan 23, 2022
1 parent 25719f8 commit e10489a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/segments/git.bash
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ segments::git::gitstatus() {
if [[ -n ${GITSTATUS_DIR:-} ]]; then
source "$GITSTATUS_DIR" || return
elif [[ ${BASH_SOURCE[0]} == */* ]]; then
source "${BASH_SOURCE[0]%/*}/gitstatus.plugin.sh" || return
local plugin="${BASH_SOURCE[0]%/*}/gitstatus.plugin.sh"
[[ -f $plugin ]] && source "$plugin" || return
else
source gitstatus.plugin.sh || return
fi
Expand Down

0 comments on commit e10489a

Please sign in to comment.