From e1a7c76a1e8a835d34a6b80c5a59fb98407bea04 Mon Sep 17 00:00:00 2001 From: Matthew Winter <33818+wintermi@users.noreply.github.com> Date: Tue, 9 Apr 2024 20:36:01 +1000 Subject: [PATCH] fix: correct the method used to obtain the version tag to focus on the current branch not across all branches --- zap.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zap.zsh b/zap.zsh index e9f494d..3118030 100644 --- a/zap.zsh +++ b/zap.zsh @@ -153,7 +153,7 @@ OPTIONS: function _zap_version() { local -Ar color=(BLUE "\033[0;34m" GREEN "\033[0;32m" RESET "\033[0m") local _branch=$(git -C "$ZAP_DIR" branch --show-current) - local _version=$(git -C "$ZAP_DIR" describe --tags `git -C "$ZAP_DIR" rev-list --tags --max-count=1`) + local _version=$(git -C "$ZAP_DIR" describe --abbrev=0 --tags) local _commit=$(git -C "$ZAP_DIR" log -1 --pretty="%h (%cr)") echo "⚡ Zap - Version\n\nVersion: ${color[GREEN]}${_branch}/${_version}${color[RESET]}\nCommit Hash: ${color[BLUE]}${_commit}${color[RESET]}" }