-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bash_ps1
More file actions
27 lines (22 loc) · 849 Bytes
/
.bash_ps1
File metadata and controls
27 lines (22 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function ps1_git_branch {
git branch 2>/dev/null | grep '^*' | colrm 1 2 | sed -e 's/.*/ &/g'
}
function ps1_go_version {
grep golang .tool-versions 2>/dev/null | sed 's/golang //'
}
function ps1_elixir {
grep elixir .tool-versions 2>/dev/null | sed 's/elixir //'
}
function ps1_erlang {
grep erlang .tool-versions 2>/dev/null | sed 's/erlang /\//'
}
function ps1_tf_version {
grep terraform .tool-versions 2>/dev/null | sed 's/terraform //'
}
function use_debian_ps1 {
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\e[38;5;150m\]\[\e[38;5;123m\]\w\[\e[00m\] \[\e[38;5;209m\]$(ps1_git_branch) \[\e[38;5;74m\]$(ps1_go_version) \[\e[38;5;105m\]$(ps1_tf_version) \[\e[38;5;129m\]$(ps1_elixir)$(ps1_erlang)\[\e[0m\]\n\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
}