diff --git a/src/bin/new_clone.sh b/src/bin/new_clone.sh index 6fc847f..0845996 100755 --- a/src/bin/new_clone.sh +++ b/src/bin/new_clone.sh @@ -19,9 +19,14 @@ if [ -z "${REPOSITORY}" ]; then echo "[!] Must set a repository path"; error=1; fi; +# if remote host is empty try to set from repository if [ -z "${REMOTE_HOST}" ]; then - echo "[!] Must set a remote host for the repository"; - error=1; + if [[ "${REPOSITORY}" == *":"* ]]; then + REMOTE_HOST=$(echo "${REPOSITORY}" | cut -d ":" -f 1); + else + echo "[!] Must set a remote host for the repository"; + error=1; + fi; fi; # if we have an ":" in the repository, split by it and replace it with the remote host if [[ "${REPOSITORY}" == *":"* ]]; then