From ecf65569cefff5201432b064c705664c80babaa0 Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Fri, 17 Jul 2020 15:50:40 +0300 Subject: [PATCH] lib: Update to stable now correctly fails if no tags are present --- lib/helpers.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/helpers.bash b/lib/helpers.bash index 51d6517b..35cabc42 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -184,7 +184,12 @@ _bash-it_update-() { # Defaults to stable update if [ -z "$1" ] || [ "$1" == "stable" ]; then version="stable" - TARGET=$(git describe --tags "$(git rev-list --tags --max-count=1)") + TARGET=$(git describe --tags "$(git rev-list --tags --max-count=1)" 2> /dev/null) + + if [[ -z "$TARGET" ]]; then + echo "Can not find tags, so can not update to latest stable version..." + return + fi else version="dev" TARGET=${BASH_IT_REMOTE}/master