diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-12 14:56:27 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-12 14:56:27 +0300 |
| commit | c2ff4241715fe80ef33b6a6e6e0d2fa523ba0089 (patch) | |
| tree | a69da06796ad41aea43835a9941e1d6fa018f8c6 /src | |
| parent | 08dcc822ece08c72805b18cbd663a4f7fecbf726 (diff) | |
Clean template context files on failure for bm0
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/template.source.sh | 9 |
1 files changed, 6 insertions, 3 deletions
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" |
