From 349b617968b9a5819d9d9befa61309691a81834e Mon Sep 17 00:00:00 2001 From: Rishi K Date: Tue, 18 Jan 2022 11:05:39 +0530 Subject: [PATCH] fix: show version beta if `git describe` doesn't find any latest release tag This can happen in case if the user downloads the plugin with `--depth=1`. --- feats/info.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feats/info.sh b/feats/info.sh index c6edad3..5f77c98 100644 --- a/feats/info.sh +++ b/feats/info.sh @@ -8,7 +8,7 @@ __smartcd::version_info() { local colr87 && colr87=$( tput setaf 87 ) local colr_reset && colr_reset=$( tput sgr 0 ) - [[ ${SMARTCD_VERSION} = *"-"* ]] && SMARTCD_VERSION=${SMARTCD_VERSION%%-*}"+beta" + [[ -z ${SMARTCD_VERSION} || ${SMARTCD_VERSION} = *"-"* ]] && SMARTCD_VERSION=${SMARTCD_VERSION%%-*}"+beta" printf '%s\n' "SmartCd by Rishi K. - ${colr87}${SMARTCD_VERSION}${colr_reset}" printf '%s\n' "The MIT License (MIT)" printf '%s\n' "Copyright (c) 2021 Rishi K."