summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgit-sonar14
1 files changed, 7 insertions, 7 deletions
diff --git a/git-sonar b/git-sonar
index 1f7b7e8..45baf13 100755
--- a/git-sonar
+++ b/git-sonar
@@ -373,7 +373,7 @@ render_prompt() {
sed_pre="%{\(\([^%^{^}]*\)\:\)\{0,1\}"
sed_post="\(\:\([^%^{^}]*\)\)\{0,1\}}"
- if [[ $PROMPT_FORMAT =~ ${if_pre}condition${if_post} ]]; then
+ if echo "$PROMPT_FORMAT" | grep -qE "${if_pre}condition${if_post}"; then
condition_result="$(repo_special_condition)"
if [[ -n "$condition_result" ]]; then
condition_sed="s/${sed_pre}condition${sed_post}/\2${condition_result}\4/"
@@ -381,7 +381,7 @@ render_prompt() {
condition_sed="s/${sed_pre}condition${sed_post}//"
fi
fi
- if [[ $PROMPT_FORMAT =~ ${if_pre}missingups${if_post} ]]; then
+ if echo "$PROMPT_FORMAT" | grep -qE "${if_pre}missingups${if_post}"; then
missingups_result="$(color_missing_upstream)"
if [[ -n "$missingups_result" ]]; then
missingups_sed="s/${sed_pre}missingups${sed_post}/\2${missingups_result}\4/"
@@ -389,7 +389,7 @@ render_prompt() {
missingups_sed="s/${sed_pre}missingups${sed_post}//"
fi
fi
- if [[ $PROMPT_FORMAT =~ ${if_pre}remote${if_post} ]]; then
+ if echo "$PROMPT_FORMAT" | grep -qE "${if_pre}remote${if_post}"; then
remote_result="$(color_remote_commits)"
if [[ -n "$remote_result" ]]; then
remote_sed="s/${sed_pre}remote${sed_post}/\2${remote_result}\4/"
@@ -397,7 +397,7 @@ render_prompt() {
remote_sed="s/${sed_pre}remote${sed_post}//"
fi
fi
- if [[ $PROMPT_FORMAT =~ ${if_pre}branch${if_post} ]]; then
+ if echo "$PROMPT_FORMAT" | grep -qE "${if_pre}branch${if_post}"; then
branch_result="$(readable_branch_name | sed -e 's/\//\\\//g')"
if [[ -n "$branch_result" ]]; then
branch_sed="s/${sed_pre}branch${sed_post}/\2${branch_result}\4/"
@@ -405,7 +405,7 @@ render_prompt() {
branch_sed="s/${sed_pre}branch${sed_post}//"
fi
fi
- if [[ $PROMPT_FORMAT =~ ${if_pre}local${if_post} ]]; then
+ if echo "$PROMPT_FORMAT" | grep -qE "${if_pre}local${if_post}"; then
local_result="$(color_local_commits)"
if [[ -n "$local_result" ]]; then
local_sed="s/${sed_pre}local${sed_post}/\2$local_result\4/"
@@ -413,7 +413,7 @@ render_prompt() {
local_sed="s/${sed_pre}local${sed_post}//"
fi
fi
- if [[ $PROMPT_FORMAT =~ ${if_pre}changes${if_post} ]]; then
+ if echo "$PROMPT_FORMAT" | grep -qE "${if_pre}changes${if_post}"; then
changes_result="$(color_changes_status)"
if [[ -n "$changes_result" ]]; then
changes_sed="s/${sed_pre}changes${sed_post}/\2${changes_result}\4/"
@@ -421,7 +421,7 @@ render_prompt() {
changes_sed="s/${sed_pre}changes${sed_post}//"
fi
fi
- if [[ $PROMPT_FORMAT =~ ${if_pre}stash${if_post} ]]; then
+ if echo "$PROMPT_FORMAT" | grep -qE "${if_pre}stash${if_post}"; then
stash_result="$(stash_status)"
if [[ -n "$stash_result" ]]; then
stash_sed="s/${sed_pre}stash${sed_post}/\2${stash_result}\4/"