refactor(switch_klipper_repo.sh): use clone_klipper function
Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
@@ -98,16 +98,13 @@ function change_klipper_repo_menu() {
|
|||||||
#================================================#
|
#================================================#
|
||||||
|
|
||||||
function switch_klipper_repo() {
|
function switch_klipper_repo() {
|
||||||
local repo_url branch
|
local repo=${1} branch=${2}
|
||||||
repo_url="https://github.com/${1}" branch=${2}
|
|
||||||
|
|
||||||
status_msg "Switching Klipper repository..."
|
status_msg "Switching Klipper repository..."
|
||||||
do_action_service "stop" "klipper"
|
do_action_service "stop" "klipper"
|
||||||
|
|
||||||
cd "${HOME}"
|
|
||||||
[[ -d ${KLIPPER_DIR} ]] && rm -rf "${KLIPPER_DIR}"
|
[[ -d ${KLIPPER_DIR} ]] && rm -rf "${KLIPPER_DIR}"
|
||||||
git clone "${repo_url}" "klipper" && cd "${KLIPPER_DIR}"
|
clone_klipper "${repo}" "${branch}"
|
||||||
git checkout "${branch}" && cd "${HOME}"
|
|
||||||
|
|
||||||
do_action_service "start" "klipper"
|
do_action_service "start" "klipper"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user