Add source_directory_files and use it everywhere
This commit is contained in:
parent
b153b5d339
commit
1c4ea43278
@ -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
|
||||||
|
}
|
||||||
|
@ -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
|
|
||||||
|
@ -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
|
||||||
|
@ -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() {
|
||||||
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user