Add source_directory_files and use it everywhere

This commit is contained in:
Ivan Malison 2016-09-06 12:51:57 -07:00
parent b153b5d339
commit 1c4ea43278
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
5 changed files with 15 additions and 14 deletions

View File

@ -67,3 +67,10 @@ function environment_variable_exists {
function command_exists { function command_exists {
hash "$1" 2>/dev/null 1>/dev/null hash "$1" 2>/dev/null 1>/dev/null
} }
function source_directory_files {
for filename in "$1"/*; do
environment_variable_exists SHELL_STARTUP_DEBUG && echo "Sourcing $filename"
source "$filename"
done
}

View File

@ -15,10 +15,4 @@ environment_variable_exists ENVIRONMENT_SETUP_DONE || _setup_env
# _ruby_setup # _ruby_setup
_python_setup _python_setup
function _source_shellenv_files { source_directory_files "$HOME/.lib/shellenv"
for filename in ~/.lib/shellenv/*; do
source $filename
done
}
_source_shellenv_files

View File

@ -5,7 +5,11 @@ function _setup_env {
add_to_path "$HOME/.local/bin" "$HOME/.lib/bin" "$HOME/bin" "/usr/local/bin" --before add_to_path "$HOME/.local/bin" "$HOME/.lib/bin" "$HOME/bin" "/usr/local/bin" --before
_ruby_setup _ruby_setup
_python_setup
# XXX/TODO:
# This is in shellenv.sh now
# _python_setup
is_osx && _osx_path_setup is_osx && _osx_path_setup
_emacs_setup _emacs_setup
_java_setup _java_setup

View File

@ -1,6 +1,4 @@
for filename in ~/.lib/shellrc/*; do source_directory_files "$HOME/.lib/shellrc"
source $filename
done
[ -s "/usr/local/bin/virtualenvwrapper.sh" ] && . /usr/local/bin/virtualenvwrapper.sh [ -s "/usr/local/bin/virtualenvwrapper.sh" ] && . /usr/local/bin/virtualenvwrapper.sh
function j() { function j() {

View File

@ -1,6 +1,4 @@
for filename in ~/.lib/zsh/*; do source_directory_files "$HOME/.lib/zsh"
source $filename
done
alias srczsh="source ~/.zshrc" alias srczsh="source ~/.zshrc"
alias zshenv="source ~/.zshenv" alias zshenv="source ~/.zshenv"