summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2020-12-23 16:06:06 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2020-12-23 16:06:06 +0100
commit5fc9273e230af1e47486055769f9a32104acbda5 (patch)
tree14c35b1a7f46a2a76d91af1e0fbba4e5f9d8f3a9 /utils
parent0fc3759d74a84229d9db39693d2b14a1b85320e0 (diff)
downloadsearxng-5fc9273e230af1e47486055769f9a32104acbda5.tar.gz
searxng-5fc9273e230af1e47486055769f9a32104acbda5.zip
[mod] utils/searx.sh install: create branch if not already exists
This patch keeps an eye on: 1. When installing searx, the branch to install needs to be a local branch. 2. The branch to install can be different from the current branch. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils')
-rwxr-xr-xutils/searx.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/searx.sh b/utils/searx.sh
index e252bd4da..3a21e2225 100755
--- a/utils/searx.sh
+++ b/utils/searx.sh
@@ -388,6 +388,14 @@ clone_searx() {
err_msg "to clone searx sources, user $SERVICE_USER hast to be created first"
return 42
fi
+ if [[ ! $(git show-ref "refs/heads/${GIT_BRANCH}") ]]; then
+ warn_msg "missing local branch ${GIT_BRANCH}"
+ info_msg "create local branch ${GIT_BRANCH} from start point: origin/${GIT_BRANCH}"
+ git branch "${GIT_BRANCH}" "origin/${GIT_BRANCH}"
+ fi
+ if [[ ! $(git branch --show-current) == "${GIT_BRANCH}" ]]; then
+ warn_msg "take into account, installing branch $GIT_BRANCH while current branch is $(git branch --show-current)"
+ fi
export SERVICE_HOME
git_clone "$REPO_ROOT" "$SEARX_SRC" \
"$GIT_BRANCH" "$SERVICE_USER"