2020-11-03 12:07:49 -08:00
|
|
|
#!/bin/bash
|
2020-11-13 10:25:04 -08:00
|
|
|
|
2022-02-20 12:44:29 -08:00
|
|
|
# PRIMARY SHELL LOAD SCRIPT - RUN FOR ALL INTERACTIVE SHELLS
|
2020-11-27 09:59:16 -08:00
|
|
|
|
2020-11-13 10:25:04 -08:00
|
|
|
# don't bother if bash is not the shell
|
|
|
|
[ ! "$SHELL" = "/bin/bash" ] && return 1
|
|
|
|
|
2022-02-20 12:44:29 -08:00
|
|
|
# ************ be sure module_load function is availABLE ***************************
|
2020-11-21 08:55:51 -08:00
|
|
|
[[ $(declare -F | grep module_load) ]] || source "$BASH_SHELL_BASE/module.lib"
|
2020-11-20 08:48:48 -08:00
|
|
|
|
2020-12-03 20:48:04 -08:00
|
|
|
module_load debug
|
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
echo "unable to load a 'debug' module using a noop for debug function"
|
|
|
|
# noop
|
|
|
|
function debug () {
|
|
|
|
:
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
2022-02-20 12:44:29 -08:00
|
|
|
([[ $BASH_ENV ]] && [[ ! $- == *i* ]] && [[ $BASH_USE_ALIAS ]]) && shopt -s expand_aliases
|
2020-11-03 12:07:49 -08:00
|
|
|
|
|
|
|
# process the base directory by default
|
2020-11-13 10:25:04 -08:00
|
|
|
unset BASH_SHELL_BASE_LOADED
|
|
|
|
unset BASH_SHELL_LOADED
|
|
|
|
|
2022-02-20 12:44:29 -08:00
|
|
|
module_load shell-process-directory
|
|
|
|
for dir in ${1:-$BASH_SHELL_DIRS}; do
|
2020-11-18 15:32:09 -08:00
|
|
|
# echo $dir
|
|
|
|
shell_process_directory $dir
|
|
|
|
[[ $dir == "$BASH_SHELL_BASE" ]] && BASH_SHELL_BASE_LOADED=true
|
|
|
|
done
|
2020-11-13 10:25:04 -08:00
|
|
|
|
|
|
|
export BASH_SHELL_LOADED=true
|
|
|
|
|
2022-02-20 12:44:29 -08:00
|
|
|
# Note: $HOME/shell or $HOME/BASH_SHELL_USER are processed via $HOME/.bashrc
|