From 2196e957f0528714f5b5397174f045dbddec495e Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Thu, 7 Jul 2022 17:49:49 +0200 Subject: [PATCH] armbian-next: logs: avoid errors by cwd'ing to SRC --- lib/functions/logging/logging.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/functions/logging/logging.sh b/lib/functions/logging/logging.sh index da978e4b9..6ab845f49 100644 --- a/lib/functions/logging/logging.sh +++ b/lib/functions/logging/logging.sh @@ -378,6 +378,9 @@ function export_html_logs() { function trap_handler_cleanup_logging() { [[ ! -d "${LOGDIR}" ]] && return 0 + # `pwd` might not even be valid anymore. Move back to ${SRC} + cd "${SRC}" || exit_with_error "cray-cray about SRC: ${SRC}" + # Just delete LOGDIR if in CONFIG_DEFS_ONLY mode. if [[ "${CONFIG_DEFS_ONLY}" == "yes" ]]; then display_alert "Discarding logs" "CONFIG_DEFS_ONLY=${CONFIG_DEFS_ONLY}" "debug"