Skip to content

Commit

Permalink
use trap
Browse files Browse the repository at this point in the history
  • Loading branch information
paliwalvimal committed Apr 2, 2024
1 parent 151f57c commit 41abc33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion terraform/build-lambda-layers
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -eu

# Script to build/upgrade lambda layers zip

trap "rm -rf "${TEMP_DIR}"" EXIT

CURRENT_DIR="$(pwd)"
TEMP_DIR="$(mktemp -d)"

Expand Down Expand Up @@ -31,4 +33,3 @@ zip -r "${CURRENT_DIR}/cryptography.zip" python
rm -rf python/*

cd "${CURRENT_DIR}"
rm -rf "${TEMP_DIR}"

0 comments on commit 41abc33

Please sign in to comment.