1
Fork 0

config: add action to set up Git prompt string

This commit is contained in:
Alan Faubert 2018-11-15 12:51:59 -05:00
parent 9317e54e95
commit 6202c5dddf
1 changed files with 10 additions and 5 deletions

View File

@ -2,9 +2,10 @@
ROOT="$(dirname "$(readlink -e "$0")")"
ROOTWIN="$(wslpath -w "$ROOT")"
while :; do
ACTION="$(whiptail --menu '' 25 100 18 \
2path '[Bash] Set up 2path.sh script' \
completion '[Bash] Set up user-specific ~/.bash_completion.d/' \
ACTION="$(whiptail --menu '' 26 100 19 \
bash-2path '[Bash] Set up 2path.sh script' \
bash-completion '[Bash] Set up user-specific ~/.bash_completion.d/' \
bash-git '[Bash] Set up Git status in prompt string' \
ssh '[SSH] Create config symlinks' \
ssh-win '[SSH] Create config symlinks [Win]' \
git '[Git] Create config symlinks' \
@ -23,14 +24,18 @@ while :; do
scancode-map-win '[Win] Swap caps lock and context key' \
--notags --default-item "$ACTION" 3>&2 2>&1 1>&3-)"
case "$ACTION" in
2path)
bash-2path)
"$ROOT"/2path.sh "$ROOT"/2path.sh
;;
completion)
bash-completion)
cd &&
mkdir -p .bash_completion.d &&
([ -f .bash_completion ] && grep -Fq .bash_completion.d .bash_completion || echo $'for i in ~/.bash_completion.d/*; do\n\t[ -f "$i" ] && . "$i"\ndone' >> .bash_completion)
;;
bash-git)
cd &&
([ -f .bashrc ] && grep -Fq __git_ps1 .bashrc || echo $'GIT_PS1_SHOWDIRTYSTATE=1\nGIT_PS1_SHOWUNTRACKEDFILES=1\nGIT_PS1_SHOWUPSTREAM=auto\nPS1=${PS1/\\\\\\$/\'$(__git_ps1 " [%s]")\\$\'}' >> .bashrc)
;;
ssh)
cd &&
rm -rf .ssh &&