Clean up scripts

This commit is contained in:
2019-12-31 00:38:46 -05:00
parent 00aca34e56
commit 362e838895
20 changed files with 280 additions and 67 deletions

View File

@@ -22,10 +22,14 @@ export TEMP=/tmp
export TMPDIR=/tmp
# Customize the shell prompt
in_git_work_tree() {
git rev-parse --is-inside-work-tree &> /dev/null
}
parse_git_branch() {
if [[ "$PWD" != "$HOME" ]]; then
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
fi
if in_git_work_tree; then
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
fi
}
export PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \w\[\033[33m\]\n$(parse_git_branch)\[\033[0;32m\]\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\]\[\033[0m\] '