From 547696abe4685ae00efb2018ffa1fdff6d33ca01 Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Thu, 16 Feb 2023 09:25:10 +0900 Subject: [PATCH] Added K2HR3CLI_GLOBAL_CONFIG_NOTUSE for plugin packages --- src/libexec/common/configuration.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/libexec/common/configuration.sh b/src/libexec/common/configuration.sh index e963d04..a5ac767 100644 --- a/src/libexec/common/configuration.sh +++ b/src/libexec/common/configuration.sh @@ -849,12 +849,21 @@ update_config_vars() # # Load global configuration file # -if [ -f "${K2HR3CLI_GLOBAL_CONFIG}" ]; then - if ! check_backquote_in_file "${K2HR3CLI_GLOBAL_CONFIG}"; then - prn_warn "${K2HR3CLI_GLOBAL_CONFIG} configuration file has back quote for shell executable charactor, then skip it loading." - else - prn_info "Loaded ${K2HR3CLI_GLOBAL_CONFIG} configuration file." - . "${K2HR3CLI_GLOBAL_CONFIG}" +# [NOTE] +# To avoid loading "/etc/antpickax/k2hr3.config" by setting the +# K2HR3CLI_GLOBAL_CONFIG_NOTUSE environment variable. +# (ex. "K2HR3CLI_GLOBAL_CONFIG_NOTUSE=1") +# This variable is intended for use in building the plugin package. +# So this is an internal variable and not documented. +# +if [ -z "${K2HR3CLI_GLOBAL_CONFIG_NOTUSE}" ]; then + if [ -f "${K2HR3CLI_GLOBAL_CONFIG}" ]; then + if ! check_backquote_in_file "${K2HR3CLI_GLOBAL_CONFIG}"; then + prn_warn "${K2HR3CLI_GLOBAL_CONFIG} configuration file has back quote for shell executable charactor, then skip it loading." + else + prn_info "Loaded ${K2HR3CLI_GLOBAL_CONFIG} configuration file." + . "${K2HR3CLI_GLOBAL_CONFIG}" + fi fi fi