added all shell configuration files

This commit is contained in:
2012-02-06 00:33:43 +00:00
parent 1eb03bd739
commit 9044b2d7af
19 changed files with 895 additions and 0 deletions

22
shell/bash/helpers.sh Normal file
View File

@@ -0,0 +1,22 @@
#
# Bash Helpers
#
function find_git_branch {
local dir=. head
until [ "$dir" -ef / ]; do
if [ -f "$dir/.git/HEAD" ]; then
head=$(< "$dir/.git/HEAD")
if [[ $head == ref:\ refs/heads/* ]]; then
git_branch=" (${head#*/*/})"
elif [[ $head != '' ]]; then
git_branch=' (detached)'
else
git_branch=' (unknown)'
fi
return
fi
dir="../$dir"
done
git_branch=''
}