utils & Makefile: add .config.mk & .config.sh for searx brands

By isolating the environment of makefiles and bash scripts into .config.mk and
.config.sh it is simple to maintain searx brands by setting some central
environments.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2020-02-04 10:39:42 +01:00
parent 94ac560dcc
commit 79e1f837ef
9 changed files with 124 additions and 56 deletions

View file

@ -32,18 +32,15 @@ if [[ -z ${DIFF_CMD} ]]; then
fi
fi
DOT_CONFIG="${DOT_CONFIG:-${REPO_ROOT}/.config}"
DOT_CONFIG="${DOT_CONFIG:-${REPO_ROOT}/.config.sh}"
source_dot_config() {
if [[ ! -e "$DOT_CONFIG" ]]; then
info_msg "installing $DOT_CONFIG"
cp "$(dirname "${BASH_SOURCE[0]}")/dot_config" "$DOT_CONFIG"
if [[ ! -z ${SUDO_USER} ]]; then
chown "${SUDO_USER}:${SUDO_USER}" "$DOT_CONFIG"
fi
if [[ ! -e "${DOT_CONFIG}" ]]; then
err_msg "configuration does not extsts at: ${DOT_CONFIG}"
return 42
fi
# shellcheck disable=SC1090
source "${REPO_ROOT}/.config"
source "${DOT_CONFIG}"
}
sudo_or_exit() {