From 2cafa5848e107394ee6518fef495427685a026ea Mon Sep 17 00:00:00 2001 From: o080o <6108882+o080o@users.noreply.github.com> Date: Mon, 18 Mar 2024 21:58:12 -0500 Subject: [PATCH] allow non-github klipper repositories, as well as ssh cloning for github+gitlab --- scripts/klipper.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/klipper.sh b/scripts/klipper.sh index 117caef..5949875 100644 --- a/scripts/klipper.sh +++ b/scripts/klipper.sh @@ -253,8 +253,12 @@ function clone_klipper() { local repo=${1} branch=${2} [[ -z ${repo} ]] && repo="${KLIPPER_REPO}" - repo=$(echo "${repo}" | sed -r "s/^(http|https):\/\/github\.com\///i; s/\.git$//") - repo="https://github.com/${repo}" + if [[ "${repo}" =~ ^(http|https):\/\/github.com || ! "$repo" =~ ^(http|https):\/\/ && ! "$repo" =~ ^git@ ]]; then + repo=$(echo "${repo}" | sed -r "s/^(http|https):\/\/github\.com\///i; s/\.git$//") + repo="https://github.com/${repo}" + else + repo=${repo} + fi [[ -z ${branch} ]] && branch="master"