From c2ff4241715fe80ef33b6a6e6e0d2fa523ba0089 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 12 Jun 2026 14:56:27 +0300 Subject: Clean template context files on failure for bm0 --- src/lib/template.source.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/template.source.sh b/src/lib/template.source.sh index 93b8187..e29458a 100644 --- a/src/lib/template.source.sh +++ b/src/lib/template.source.sh @@ -314,9 +314,12 @@ source_template_file() { return "$status" fi - env -i PATH="$PATH" BASH_ENV="$context_file" \ - bash -euo pipefail -- "$template_path" >> "$output_path" - status=$? + if env -i PATH="$PATH" BASH_ENV="$context_file" \ + bash -euo pipefail -- "$template_path" >> "$output_path"; then + status=0 + else + status=$? + fi rm -f "$context_file" if (( status != 0 )); then return "$status" -- cgit v1.2.3