CONFIG: support optional config.sh/readline file

- provides a hook for specifying alternative locations
This commit is contained in:
Mark Olesen
2020-12-11 21:18:02 +01:00
parent 4c501c4567
commit b89f389606

View File

@ -16,8 +16,11 @@
# Description # Description
# Detection/setup of READLINE # Detection/setup of READLINE
# #
# Requires # Optional
# None # config.sh/readline
#
# Environment
# READLINE_ARCH_PATH
# #
# Functions provided # Functions provided
# have_readline, no_readline, echo_readline, search_readline # have_readline, no_readline, echo_readline, search_readline
@ -27,6 +30,8 @@
# READLINE_INC_DIR # READLINE_INC_DIR
# READLINE_LIB_DIR # READLINE_LIB_DIR
# #
# Without a config file, defaults to system
#
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
. ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions # General system functions . ${WM_PROJECT_DIR:?}/wmake/scripts/sysFunctions # General system functions
@ -108,7 +113,16 @@ search_readline()
# Output as per search_* function # Output as per search_* function
have_readline() have_readline()
{ {
search_readline system local config="config.sh/readline"
local file
# Allow missing file
if file="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then
. "$file"
fi
search_readline "$READLINE_ARCH_PATH"
} }