From cf7fe9fac20a8adcb8204e66d4a5bc20004f5b31 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mar 11 2023 13:12:07 +0000 Subject: sync-ostree-containers: Fix trap cleanup Definitely regretting not going the route Clément suggested and doing this in Rust... Signed-off-by: Colin Walters --- diff --git a/scripts/sync-ostree-base-containers.sh b/scripts/sync-ostree-base-containers.sh index 48abfd2..9f2500b 100755 --- a/scripts/sync-ostree-base-containers.sh +++ b/scripts/sync-ostree-base-containers.sh @@ -58,7 +58,10 @@ arch_to_goarch() { } work_tmpdir=$(mktemp -d -p /var/tmp --suffix=.sync-ostree) -trap "{ rm -rf $work_tmpdir }" EXIT +cleanup() { + rm -rf "${work_tmpdir}" +} +trap cleanup EXIT cd "${work_tmpdir}" for name in "${ostree_base_images[@]}"; do