Download:
child 35:44a6ddc7f222
parent 33:b0de9677e28d
34:6d42e8d89e7e
Anton Shestakov <engored@ya.ru>, Wed, 27 Aug 2014 03:54:46 +0900
.bash_prompt: replace grep with "string contains" bashism.

1 файлов изменено, 3 вставок(+), 3 удалений(-) [+]
.bash_prompt file | annotate | diff | comparison | revisions
--- a/.bash_prompt Wed Aug 27 03:39:55 2014 +0900
+++ b/.bash_prompt Wed Aug 27 03:54:46 2014 +0900
@@ -70,13 +70,13 @@
local GIT_STATUS=$(LC_ALL=C git status 2>/dev/null)
local GIT_BRANCH=$(grep -Po '(?<=On branch ).*$' <<< "$GIT_STATUS")
- if [[ $(grep "Your branch is behind" <<< "$GIT_STATUS") ]]; then
+ if [[ $GIT_STATUS == *'Your branch is behind'* ]]; then
local GIT_UPDATE="$R^"
fi
- if [[ $(grep "Changes to be committed" <<< "$GIT_STATUS") ]]; then
+ if [[ $GIT_STATUS == *'Changes to be committed'* ]]; then
local GIT_STAGED="$R!"
fi
- if [[ $(grep "Changes not staged" <<< "$GIT_STATUS") ]]; then
+ if [[ $GIT_STATUS == *'Changes not staged'* ]]; then
local GIT_UNSTAGED="$P?"
fi