feat(octoeverywhere): implement update function #310

Merged
dw-0 merged 2 commits from oe-updater into master 2023-03-11 20:25:17 +01:00
Showing only changes of commit b6bcaa2075 - Show all commits

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}"
QuinnDamerell commented 2023-03-11 00:16:41 +01:00 (Migrated from github.com)
Review

Will this handle the octoeveryhere-* other possible service names?

Will this handle the octoeveryhere-* other possible service names?
dw-0 commented 2023-03-11 08:37:52 +01:00 (Migrated from github.com)
Review

Yes, calling that function handles all services beginning with "octoeverywhere".

Yes, calling that function handles all services beginning with "octoeverywhere".
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"