From d1a7673520113ab76be45e7c6cfaeec0c3c31c32 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sun, 17 Apr 2022 19:03:51 +0200 Subject: [PATCH] fix: make klipper install account for custom klipper repo Signed-off-by: Dominik Willner th33xitus@gmail.com --- scripts/klipper.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/klipper.sh b/scripts/klipper.sh index 917eb0e..54dc677 100644 --- a/scripts/klipper.sh +++ b/scripts/klipper.sh @@ -134,16 +134,28 @@ function create_klipper_virtualenv(){ } function klipper_setup(){ + read_kiauh_ini + local custom_repo="${custom_klipper_repo}" + local custom_branch="${custom_klipper_repo_branch}" local instances=${1} python_version=${2} ### checking dependencies local dep=(git) dependency_check "${dep[@]}" ### step 1: clone klipper - status_msg "Downloading Klipper ..." ### force remove existing klipper dir and clone into fresh klipper dir [ -d "${KLIPPER_DIR}" ] && rm -rf "${KLIPPER_DIR}" - cd "${HOME}" && git clone "${KLIPPER_REPO}" + if [ -z "${custom_repo}" ]; then + status_msg "Downloading Klipper ..." + cd "${HOME}" && git clone "${KLIPPER_REPO}" + else + local repo_name + repo_name=$(echo "${custom_repo}" | sed "s/https:\/\/github\.com\///" | sed "s/\.git$//" ) + status_msg "Downloading Klipper from ${repo_name} ..." + cd "${HOME}" && git clone "${custom_repo}" "klipper" + cd "${KLIPPER_DIR}" && git checkout "${custom_branch}" + cd "${HOME}" + fi ### step 2: install klipper dependencies and create python virtualenv install_klipper_packages "${python_version}"