Skip to content

Commit 0a05aca

Browse files
committed
fix: use _cleanup hook instead of overriding cleanup()
download-artifacts.sh sources library.sh which already registers `trap cleanup EXIT`. Defining a local cleanup() was overriding the library's version and breaking the standard cleanup chain (killing child processes). Rename to _cleanup() so it participates in the hook mechanism correctly, and drop the redundant trap registration.
1 parent 889bd1f commit 0a05aca

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

internal-scripts/ci-cd/download-artifacts.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CI_ARTIFACTS_RUN_NUMBER=${CI_ARTIFACTS_RUN_NUMBER:-$GITHUB_RUN_NUMBER}
1616
CLEAR=${CLEAR:-false}
1717
TMPDIR=${TMPDIR:-/tmp}
1818

19-
function cleanup()
19+
function _cleanup()
2020
{
2121
if [[ -n "$WORK_DIR" ]]; then
2222
rm -rf "$WORK_DIR"
@@ -39,7 +39,6 @@ echo
3939

4040
echo "--> Downloading artifacts"
4141
WORK_DIR=$(mktemp -d "$TMPDIR/XXXXXX")
42-
trap cleanup EXIT
4342
mkdir -p "$ARTIFACT_PATH"
4443
gsutil -m cp "${URLS[@]}" "$WORK_DIR/"
4544
echo

0 commit comments

Comments
 (0)