fix: implement clone function
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -276,7 +276,7 @@ function update_octoeverywhere() {
|
|||||||
do_action_service "stop" "octoeverywhere"
|
do_action_service "stop" "octoeverywhere"
|
||||||
|
|
||||||
if [[ ! -d ${OCTOEVERYWHERE_DIR} ]]; then
|
if [[ ! -d ${OCTOEVERYWHERE_DIR} ]]; then
|
||||||
clone_moonraker "${OCTOEVERYWHERE_DIR}"
|
clone_octoeverywhere "${OCTOEVERYWHERE_REPO}"
|
||||||
else
|
else
|
||||||
backup_before_update "octoeverywhere"
|
backup_before_update "octoeverywhere"
|
||||||
status_msg "Updating OctoEverywhere for Klipper ..."
|
status_msg "Updating OctoEverywhere for Klipper ..."
|
||||||
@@ -291,6 +291,21 @@ function update_octoeverywhere() {
|
|||||||
do_action_service "restart" "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() {
|
function install_octoeverywhere_dependencies() {
|
||||||
local packages
|
local packages
|
||||||
local install_script="${OCTOEVERYWHERE_DIR}/install.sh"
|
local install_script="${OCTOEVERYWHERE_DIR}/install.sh"
|
||||||
|
|||||||
Reference in New Issue
Block a user