Skip to content

Commit c62e05e

Browse files
committed
fix trap
1 parent 2221898 commit c62e05e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/main/resources/io/viash/helpers/bashutils/ViashDockerFuns.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,13 @@ function ViashDockerBuild {
220220
# create temporary directory to store dockerfile & optional resources in
221221
local tmpdir=$(mktemp -d "$VIASH_META_TEMP_DIR/dockerbuild-$VIASH_META_NAME-XXXXXX")
222222
local dockerfile="$tmpdir/Dockerfile"
223-
function clean_up {
224-
rm -rf "$tmpdir"
223+
224+
# Use a unique cleanup function name to avoid conflicts
225+
VIASH_DOCKER_BUILD_TMPDIR="$tmpdir"
226+
function ViashDockerBuildCleanup {
227+
rm -rf "$VIASH_DOCKER_BUILD_TMPDIR"
225228
}
226-
trap clean_up EXIT
229+
ViashRegisterCleanup ViashDockerBuildCleanup
227230

228231
# store dockerfile and resources
229232
ViashDockerfile "$VIASH_ENGINE_ID" > "$dockerfile"

0 commit comments

Comments
 (0)