refactor(klipperscreen.sh): exit if cloning and installing klipperscreen failed
Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
@@ -41,17 +41,24 @@ function install_klipperscreen() {
|
|||||||
function klipperscreen_setup() {
|
function klipperscreen_setup() {
|
||||||
local dep=(wget curl unzip dfu-util)
|
local dep=(wget curl unzip dfu-util)
|
||||||
dependency_check "${dep[@]}"
|
dependency_check "${dep[@]}"
|
||||||
status_msg "Downloading KlipperScreen ..."
|
status_msg "Cloning KlipperScreen from ${KLIPPERSCREEN_REPO} ..."
|
||||||
|
|
||||||
# force remove existing KlipperScreen dir
|
# force remove existing KlipperScreen dir
|
||||||
[[ -d ${KLIPPERSCREEN_DIR} ]] && rm -rf "${KLIPPERSCREEN_DIR}"
|
[[ -d ${KLIPPERSCREEN_DIR} ]] && rm -rf "${KLIPPERSCREEN_DIR}"
|
||||||
|
|
||||||
# clone into fresh KlipperScreen dir
|
# clone into fresh KlipperScreen dir
|
||||||
cd "${HOME}" && git clone "${KLIPPERSCREEN_REPO}"
|
if ! git clone "${KLIPPERSCREEN_REPO}" "${KLIPPERSCREEN_DIR}"; then
|
||||||
ok_msg "Download complete!"
|
print_error "Cloning KlipperScreen from\n ${KLIPPERSCREEN_REPO}\n failed!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
status_msg "Installing KlipperScreen ..."
|
status_msg "Installing KlipperScreen ..."
|
||||||
"${KLIPPERSCREEN_DIR}"/scripts/KlipperScreen-install.sh
|
if "${KLIPPERSCREEN_DIR}"/scripts/KlipperScreen-install.sh; then
|
||||||
ok_msg "KlipperScreen successfully installed!"
|
ok_msg "KlipperScreen successfully installed!"
|
||||||
|
else
|
||||||
|
print_error "KlipperScreen installation failed!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#===================================================#
|
#===================================================#
|
||||||
|
|||||||
Reference in New Issue
Block a user