lib: Update to stable now correctly fails if no tags are present

pull/1626/head
Noah Gorny 2020-07-17 15:50:40 +03:00
parent d8c2256c39
commit ecf65569ce
1 changed files with 6 additions and 1 deletions

View File

@ -184,7 +184,12 @@ _bash-it_update-() {
# Defaults to stable update # Defaults to stable update
if [ -z "$1" ] || [ "$1" == "stable" ]; then if [ -z "$1" ] || [ "$1" == "stable" ]; then
version="stable" 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 else
version="dev" version="dev"
TARGET=${BASH_IT_REMOTE}/master TARGET=${BASH_IT_REMOTE}/master