From 989911c595b19aac9ecb4aa87eb2ac4d57610c86 Mon Sep 17 00:00:00 2001 From: Claudio Bandera Date: Fri, 28 Aug 2015 10:35:47 +0200 Subject: Added git stash indicator --- prompt.bash | 1 + radar-base.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/prompt.bash b/prompt.bash index a3fe420..4d9a36f 100755 --- a/prompt.bash +++ b/prompt.bash @@ -10,4 +10,5 @@ if is_repo; then bash_color_local_commits printf "\x01\033[1;30m\x02)\x01\033[0m\x02" bash_color_changes_status + bash_stash_status fi diff --git a/radar-base.sh b/radar-base.sh index b7074d8..aa8ed2f 100755 --- a/radar-base.sh +++ b/radar-base.sh @@ -469,3 +469,17 @@ zsh_color_remote_commits() { printf %s "$remote" } + +bash_stash_status() { + local number_stashes="$(git stash list | wc -l)" + if [ $number_stashes -gt 0 ]; then + printf " $number_stashes\x01\033[1;33m\x02␣\x01\033[0m\x02)" + fi +} + +zsh_stash_status() { + local number_stashes="$(git stash list | wc -l)" + if [ $number_stashes -gt 0 ]; then + printf %s " $number_stashes%{$fg_bold[yellow]%}␣%{$reset_color%})" + fi +} \ No newline at end of file -- cgit v1.2.3