diff options
author | Michael Allen <michael@michaelallen.io> | 2015-09-16 14:21:43 +0100 |
---|---|---|
committer | Michael Allen <michael@michaelallen.io> | 2015-09-16 14:22:27 +0100 |
commit | 9cfc2ed7f46fa9dea9fbeeef51a8ea8883c41c59 (patch) | |
tree | f32dba799ab8def8fd49a5f27b1ae77c6d402801 | |
parent | 1fcd42c3ecc41b6a6c4c9e75b6bfe274a1b595e2 (diff) | |
download | git-sonar-9cfc2ed7f46fa9dea9fbeeef51a8ea8883c41c59.tar.gz git-sonar-9cfc2ed7f46fa9dea9fbeeef51a8ea8883c41c59.zip |
Merge bash and zsh specific render functions
Diffstat (limited to '')
-rwxr-xr-x | radar-base.sh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/radar-base.sh b/radar-base.sh index 2ad9ce7..12cab90 100755 --- a/radar-base.sh +++ b/radar-base.sh @@ -12,6 +12,8 @@ prepare_bash_colors() { source "$rcfile_path/.gitradarrc" fi + PRINT_F_OPTION="" + COLOR_REMOTE_AHEAD="\x01${GIT_RADAR_COLOR_REMOTE_AHEAD:-"\\033[1;32m"}\x02" COLOR_REMOTE_BEHIND="\x01${GIT_RADAR_COLOR_REMOTE_BEHIND:-"\\033[1;31m"}\x02" COLOR_REMOTE_DIVERGED="\x01${GIT_RADAR_COLOR_REMOTE_DIVERGED:-"\\033[1;33m"}\x02" @@ -42,6 +44,8 @@ prepare_zsh_colors() { source "$rcfile_path/.gitradarrc" fi + PRINT_F_OPTION="%s" + COLOR_REMOTE_AHEAD="%{${GIT_RADAR_COLOR_REMOTE_AHEAD:-$fg_bold[green]}%}" COLOR_REMOTE_BEHIND="%{${GIT_RADAR_COLOR_REMOTE_BEHIND:-$fg_bold[red]}%}" COLOR_REMOTE_DIVERGED="%{${GIT_RADAR_COLOR_REMOTE_DIVERGED:-$fg_bold[yellow]}%}" @@ -398,7 +402,7 @@ bash_color_changes_status() { changes="$staged_changes$conflicted_changes$unstaged_changes$untracked_changes" fi - printf "$changes" + printf $PRINT_F_OPTION "$changes" } zsh_color_changes_status() { @@ -430,7 +434,7 @@ zsh_color_changes_status() { changes="$staged_changes$conflicted_changes$unstaged_changes$untracked_changes" fi - printf %s "$changes" + printf $PRINT_F_OPTION "$changes" } bash_color_local_commits() { @@ -453,7 +457,7 @@ bash_color_local_commits() { local_commits="$separator$local_ahead$green_ahead_arrow" fi fi - printf "$local_commits" + printf $PRINT_F_OPTION "$local_commits" } zsh_color_local_commits() { @@ -476,7 +480,7 @@ zsh_color_local_commits() { local_commits="$separator$local_ahead$ahead_arrow" fi fi - printf %s "$local_commits" + printf $PRINT_F_OPTION "$local_commits" } bash_color_remote_commits() { @@ -500,7 +504,7 @@ bash_color_remote_commits() { remote="upstream $not_upstream " fi - printf "$remote" + printf $PRINT_F_OPTION "$remote" } zsh_color_remote_commits() { @@ -524,7 +528,7 @@ zsh_color_remote_commits() { remote="upstream $not_upstream " fi - printf %s "$remote" + printf $PRINT_F_OPTION "$remote" } show_remote_status() { if [[ $@ == *$NO_REMOTE_STATUS* ]]; then |