From 2c989eeb08aedda4b00752bc4e5dafc91e27830b Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Fri, 4 Jul 2025 13:38:12 +0900 Subject: [PATCH] new clone fix for repository and remote host options --- src/bin/new_clone.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bin/new_clone.sh b/src/bin/new_clone.sh index 7958a1b..5628a28 100755 --- a/src/bin/new_clone.sh +++ b/src/bin/new_clone.sh @@ -15,9 +15,17 @@ BASE_FOLDER=$(dirname "$(readlink -f "$0")")"/"; # shellcheck source=init.sh . "${BASE_FOLDER}init.sh"; +if [ -z "${REPOSITORY}" ]; then + echo "[!] Must set a repository path"; + error=1; +fi; if [ -z "${REMOTE_HOST}" ]; then echo "[!] Must set a remote host for the repository"; - exit; + error=1; +fi; +# if we have an ":" in the repository, split by it and replace it with the remote host +if [[ "${REPOSITORY}" == *":"* ]]; then + REPOSITORY=$(echo "${REPOSITORY}" | cut -d ":" -f 2); fi; error=0