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"