Make shellenv directory.

This commit is contained in:
Ivan Malison 2014-11-20 23:01:50 -08:00
parent 9b44d35171
commit 5a178299a1
3 changed files with 13 additions and 3 deletions

View File

@ -1,5 +1,9 @@
source ~/.lib/shellrc/functions.sh
source ~/.lib/shellrc/emacs.sh
source ~/.lib/shellenv/functions.sh
for filename in ~/.lib/shellenv/*; do
source $filename
done
function add_to_front_of_path {
export PATH=$@:$(echo $PATH | sed "s|:*$@||g" | sed "s|^:||")
}
@ -34,6 +38,6 @@ add_to_back_of_path "/usr/local/sbin"
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
function shellrc {
function with_shellrc {
zsh -c "source ~/.zshrc && ""$@"
}

View File

@ -1,3 +1,9 @@
shell_contains () {
local e
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done
return 1
}
function dotfiles_directory() {
echo $(dirname `readlink -f ~/.zshrc | xargs dirname`)
}