fix: avoid update failure on /opt/sk cwd
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user