summaryrefslogtreecommitdiffstats
path: root/radar-base.sh
diff options
context:
space:
mode:
authorMichael Allen <michael@michaelallen.io>2015-09-14 17:22:01 +0100
committerMichael Allen <michael@michaelallen.io>2015-09-16 15:30:03 +0100
commit8c682d2abddd006398e9aed0a61212b4648b5a59 (patch)
tree6ec2b82e8f62b27baa6792e2b66e88513945d688 /radar-base.sh
parent1f6a8f84946a0cb6936916f47b5a3870fa12a5a6 (diff)
downloadgit-sonar-8c682d2abddd006398e9aed0a61212b4648b5a59.tar.gz
git-sonar-8c682d2abddd006398e9aed0a61212b4648b5a59.zip
Basic approach to format strings
Diffstat (limited to 'radar-base.sh')
-rwxr-xr-xradar-base.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/radar-base.sh b/radar-base.sh
index d9cd8f5..e21122a 100755
--- a/radar-base.sh
+++ b/radar-base.sh
@@ -65,6 +65,8 @@ prepare_zsh_colors() {
COLOR_BRANCH="%{${GIT_RADAR_COLOR_BRANCH:-$reset_color}%}"
MASTER_SYMBOL="${GIT_RADAR_MASTER_SYMBOL:-"%{$reset_color%}$italic_m%{$reset_color%}"}"
+ PROMPT_FORMAT="${GIT_RADAR_FORMAT:-""}"
+
RESET_COLOR_LOCAL="%{${GIT_RADAR_COLOR_LOCAL_RESET:-$reset_color}%}"
RESET_COLOR_REMOTE="%{${GIT_RADAR_COLOR_REMOTE_RESET:-$reset_color}%}"
RESET_COLOR_CHANGES="%{${GIT_RADAR_COLOR_CHANGES_RESET:-$reset_color}%}"
@@ -484,3 +486,18 @@ show_remote_status() {
fi
return 0
}
+
+render_prompt() {
+ if [[ $PROMPT_FORMAT =~ ^.*%{remote}.*$ ]]; then
+ zsh_color_remote_commits
+ fi
+ if [[ $PROMPT_FORMAT =~ ^.*%{branch}.*$ ]]; then
+ zsh_readable_branch_name
+ fi
+ if [[ $PROMPT_FORMAT =~ ^.*%{local}.*$ ]]; then
+ zsh_color_local_commits
+ fi
+ if [[ $PROMPT_FORMAT =~ ^.*%{changes}.*$ ]]; then
+ zsh_color_changes_status
+ fi
+}