lib: store list of libs loaded

pull/1907/head
John D Pell 2021-09-12 13:41:32 -07:00
parent 72186ce1d7
commit ed08946463
4 changed files with 9 additions and 8 deletions

View File

@ -3,11 +3,11 @@
# A collection of reusable functions. # A collection of reusable functions.
# Avoid duplicate inclusion # Avoid duplicate inclusion
if [[ -n "${__bash_it_lib_helpers:-}" ]] if [[ "${__bash_it_lib_loaded[*]:-}" == *"${BASH_SOURCE#*/}"* ]]
then then
return 0 return 0
fi fi
__bash_it_lib_helpers="loaded" __bash_it_lib_loaded=( "${BASH_SOURCE#*/}" "${__bash_it_lib_loaded[@]:-}" )
BASH_IT_LOAD_PRIORITY_DEFAULT_ALIAS=${BASH_IT_LOAD_PRIORITY_DEFAULT_ALIAS:-150} BASH_IT_LOAD_PRIORITY_DEFAULT_ALIAS=${BASH_IT_LOAD_PRIORITY_DEFAULT_ALIAS:-150}
BASH_IT_LOAD_PRIORITY_DEFAULT_PLUGIN=${BASH_IT_LOAD_PRIORITY_DEFAULT_PLUGIN:-250} BASH_IT_LOAD_PRIORITY_DEFAULT_PLUGIN=${BASH_IT_LOAD_PRIORITY_DEFAULT_PLUGIN:-250}

View File

@ -3,11 +3,11 @@
# A collection of logging functions. # A collection of logging functions.
# Avoid duplicate inclusion # Avoid duplicate inclusion
if [[ -n "${__bash_it_lib_log:-}" ]] if [[ "${__bash_it_lib_loaded[*]:-}" == *"${BASH_SOURCE#*/}"* ]]
then then
return 0 return 0
fi fi
__bash_it_lib_log="loaded" __bash_it_lib_loaded=( "${BASH_SOURCE#*/}" "${__bash_it_lib_loaded[@]:-}" )
export BASH_IT_LOG_LEVEL_ERROR=1 export BASH_IT_LOG_LEVEL_ERROR=1
export BASH_IT_LOG_LEVEL_WARNING=2 export BASH_IT_LOG_LEVEL_WARNING=2

View File

@ -3,11 +3,12 @@
# Search by Konstantin Gredeskoul «github.com/kigster» # Search by Konstantin Gredeskoul «github.com/kigster»
# Avoid duplicate inclusion # Avoid duplicate inclusion
if [[ -n "${__bash_it_lib_search:-}" ]] if [[ "${__bash_it_lib_loaded[*]:-}" == *"${BASH_SOURCE#*/}"* ]]
then then
return 0 return 0
fi fi
__bash_it_lib_search="loaded" __bash_it_lib_loaded=( "${BASH_SOURCE#*/}" "${__bash_it_lib_loaded[@]:-}" )
#——————————————————————————————————————————————————————————————————————————————— #———————————————————————————————————————————————————————————————————————————————
# This function returns list of aliases, plugins and completions in bash-it, # This function returns list of aliases, plugins and completions in bash-it,
# whose name or description matches one of the search terms provided as arguments. # whose name or description matches one of the search terms provided as arguments.

View File

@ -3,11 +3,11 @@
# A collection of reusable functions. # A collection of reusable functions.
# Avoid duplicate inclusion # Avoid duplicate inclusion
if [[ -n "${__bash_it_lib_utilities:-}" ]] if [[ "${__bash_it_lib_loaded[*]:-}" == *"${BASH_SOURCE#*/}"* ]]
then then
return 0 return 0
fi fi
__bash_it_lib_utilities="loaded" __bash_it_lib_loaded=( "${BASH_SOURCE#*/}" "${__bash_it_lib_loaded[@]:-}" )
########################################################################### ###########################################################################
# Generic utilies # Generic utilies