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 {
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
_python_setup
function _source_shellenv_files {
for filename in ~/.lib/shellenv/*; do
source $filename
done
}
_source_shellenv_files
source_directory_files "$HOME/.lib/shellenv"

View File

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

View File

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

View File

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