mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 21:59:22 +02:00
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:
parent
94ac560dcc
commit
79e1f837ef
9 changed files with 124 additions and 56 deletions
13
utils/lib.sh
13
utils/lib.sh
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue