From 70e5122a1f735c5b0e39ddcd88c41e7cfbebe7df Mon Sep 17 00:00:00 2001 From: pvincent Date: Fri, 16 Aug 2019 00:45:56 +0400 Subject: [PATCH] when no tag release found --- bash.bashrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bash.bashrc b/bash.bashrc index 2a6009e..dc4806e 100644 --- a/bash.bashrc +++ b/bash.bashrc @@ -110,7 +110,11 @@ __prompt_command() { PS1+="${Blu}↑${ahead}" else tag_release=`git describe --exact-match --tags $(git log -n1 --pretty='%h')` - PS1+="${Gre}✔${R}|${Blu}${tag_release}" + if [[ -z $tag_release ]];then + PS1+="{Red}✔" + else + PS1+="${Gre}✔${R}|${Blu}${tag_release}" + fi fi fi PS1+="${R}]"