fix: avoid update failure on /opt/sk cwd

This commit is contained in:
2026-01-15 17:39:40 +01:00
parent 835244b7e0
commit 5850ef8358
4 changed files with 40 additions and 1 deletions

View File

@ -87,6 +87,14 @@ cleanup() {
}
trap cleanup EXIT
error_exit() {
local msg="${1:-update failed}"
SKD_VERSION="${VERSION:-unknown}" SKD_STATUS="failed" SKD_ERROR="${msg}" \
SKD_TIMESTAMP="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" SKD_STATUS_FILE="${STATUS_FILE}" \
SKD_LOG_FILE="${LOG_FILE}" report_status "failed" "${msg}"
}
trap 'error_exit "update failed at line ${LINENO}"' ERR
require_cmd() {
if ! command -v "$1" >/dev/null 2>&1; then
echo "Required command not found: $1" >&2