remote host auto set if not given

This commit is contained in:
2025-07-04 13:46:06 +09:00
parent cc2a3e7da4
commit 221d1b3d35

View File

@@ -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