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