Skip to content

Commit

Permalink
Merge pull request #28 from ggtakec/update_load_config
Browse files Browse the repository at this point in the history
Added K2HR3CLI_GLOBAL_CONFIG_NOTUSE for plugin packages
  • Loading branch information
ggtakec authored Feb 16, 2023
2 parents 5308b37 + 547696a commit 8f9b65b
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/libexec/common/configuration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8f9b65b

Please sign in to comment.