diff options
author | Michael Allen <michael@michaelallen.io> | 2015-08-06 10:03:34 +0100 |
---|---|---|
committer | Michael Allen <michael@michaelallen.io> | 2015-08-06 10:03:34 +0100 |
commit | bff1f0488e7b3cb1f4b89c698dbc282bd9a5c0aa (patch) | |
tree | 1a1d37a9020a0a458e6785739c0227816c22996f | |
parent | 6b40c172f04036931886a92c200197ef7bd9917f (diff) | |
download | git-sonar-bff1f0488e7b3cb1f4b89c698dbc282bd9a5c0aa.tar.gz git-sonar-bff1f0488e7b3cb1f4b89c698dbc282bd9a5c0aa.zip |
Preserve whitespace in function results
-rwxr-xr-x | git-base.sh | 8 | ||||
-rwxr-xr-x | prompt.sh | 20 |
2 files changed, 5 insertions, 23 deletions
diff --git a/git-base.sh b/git-base.sh index afd4f7e..11a88c5 100755 --- a/git-base.sh +++ b/git-base.sh @@ -331,7 +331,7 @@ bash_color_changes_status() { changes="$staged_changes$conflicted_changes$unstaged_changes$untracked_changes" fi - echo $changes + echo "$changes" } zsh_color_changes_status() { @@ -367,7 +367,7 @@ zsh_color_changes_status() { changes="$staged_changes$conflicted_changes$unstaged_changes$untracked_changes" fi - echo $changes + echo "$changes" } bash_color_local_commits() { @@ -393,7 +393,7 @@ bash_color_local_commits() { fi fi fi - echo $local_commits + echo "$local_commits" } zsh_color_local_commits() { @@ -419,5 +419,5 @@ zsh_color_local_commits() { fi fi fi - echo $local_commits + echo "$local_commits" } @@ -1,23 +1,5 @@ source ./git-base.sh -local_ahead="$(commits_ahead_of_remote)" -ahead_arrow="↑" - -if [[ ("$local_ahead" -gt 0) ]]; then - local_ahead=" ${local_ahead}${ahead_arrow}" -else - local_ahead="" -fi - -local_behind="$(commits_behind_of_remote)" -behind_arrow="↓" - -if [[ "$local_behind" -gt "0" ]]; then - local_behind=" ${local_behind}${behind_arrow}" -else - local_behind="" -fi - -prompt="$(branch_name) $(bash_color_local_commits) $(bash_color_changes_status)" +prompt="$(branch_name)$(bash_color_local_commits)$(bash_color_changes_status)" echo $prompt |