Skip to content

Commit 3ff90c8

Browse files
committed
Już ostatni, format, podpatrzony u Gynvaela. B)
1 parent a9e2700 commit 3ff90c8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

actions/chce_git_status_PS1.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,12 @@ choose_ps1_format() {
195195
3.<USER>@<HOST> <PWD> (<GIT-STATUS>)<ONL>$
196196
4.<USER>@<HOST> \\e[33m<PWD>\\e[00m (<GIT-STATUS>)<ONL>$
197197
5.<USER>@<HOST> \\e[33m<PWD>\\e[00m <GIT-STATUS><ONL>$
198+
6.<USER>@<HOST> \\e[33m<PWD>\\e[00m <GIT-STATUS><ONL><DATE>$
198199
'
199200
echo "$FORMATS" 1>&2
200201
read -p "Wybierz format: " format_nr
201202
case $format_nr in
202-
1|2|3|4|5) : ;;
203+
1|2|3|4|5|6) : ;;
203204
*) echo "Niepoprawny wybor." 1>&2; return -1 ;;
204205
esac
205206
format=$(echo "$FORMATS" | grep -F $format_nr.)
@@ -220,6 +221,10 @@ choose_ps1_format() {
220221
format=${format/"<HOST>"/\\h}
221222
format=${format/"<PWD>"/\\w}
222223
format=${format/"<GIT-STATUS>"/'$(__git_ps1 %s)'}
224+
if test $format_nr -eq '6'
225+
then
226+
format=${format/"<DATE>"/'$(date +[%H:%M])'}
227+
fi
223228

224229
echo $format
225230
unset format

0 commit comments

Comments
 (0)