fix: implement clone function

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
th33xitus
2023-03-11 09:05:32 +01:00
parent 6e0351a924
commit b6bcaa2075

View File

@@ -276,7 +276,7 @@ function update_octoeverywhere() {
do_action_service "stop" "octoeverywhere"
if [[ ! -d ${OCTOEVERYWHERE_DIR} ]]; then
clone_moonraker "${OCTOEVERYWHERE_DIR}"
clone_octoeverywhere "${OCTOEVERYWHERE_REPO}"
else
backup_before_update "octoeverywhere"
status_msg "Updating OctoEverywhere for Klipper ..."
@@ -291,6 +291,21 @@ function update_octoeverywhere() {
do_action_service "restart" "octoeverywhere"
}
function clone_octoeverywhere() {
local repo=${1}
status_msg "Cloning OctoEverywhere from ${repo} ..."
### force remove existing octoeverywhere dir and clone into fresh octoeverywhere dir
[[ -d ${OCTOEVERYWHERE_DIR} ]] && rm -rf "${OCTOEVERYWHERE_DIR}"
cd "${HOME}" || exit 1
if ! git clone "${OCTOEVERYWHERE_REPO}" "${OCTOEVERYWHERE_DIR}"; then
print_error "Cloning OctoEverywhere from\n ${repo}\n failed!"
exit 1
fi
}
function install_octoeverywhere_dependencies() {
local packages
local install_script="${OCTOEVERYWHERE_DIR}/install.sh"