Skip to content

Commit

Permalink
Merge pull request #77 from buildkite-plugins/toote_minor_fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
pzeballos authored Jul 25, 2024
2 parents 65f2a31 + 811deb3 commit cc06d4a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ fi
# Creates the annotations with all the report URLs
annotation-link() {
local json_file="$1"
mapfile -t REPORT_URLS < <(sort "${json_file}" | uniq)
REPORT_URLS=()
while IFS= read -r line; do REPORT_URLS+=("${line}"); done < <(sort "${json_file}" | uniq)

local REPORTS=""
REPORT_COUNT=1
Expand Down Expand Up @@ -189,7 +190,7 @@ find_and_upload() {

for index in "${!uploads_in_progress[@]}"; do
# Note: kill -0 does not kill the pid, it provides a *nix compatible way to test the pid is responding.
if ! kill -0 "${uploads_in_progress[index]}" > /dev/null; then
if ! kill -0 "${uploads_in_progress[index]}" > /dev/null 2>&1; then
unset 'uploads_in_progress[index]'
elif [[ "$iterations_waited" -gt $TIMEOUT ]]; then
echo "Upload '${uploads_in_progress[index]}' has been running for more than '${TIMEOUT}' seconds, killing it"
Expand Down Expand Up @@ -252,4 +253,4 @@ else
fi
if [ "$ANNOTATE" != "false" ]; then
annotation-link "${REPORT_URLS_FILE}"
fi
fi

0 comments on commit cc06d4a

Please sign in to comment.