From 562d4241607afc9773c4158f90877660344f16c9 Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Wed, 27 Jul 2022 07:20:50 +1000 Subject: [PATCH] Fix: Ignore unbounded variable BUILD_RESULT Error: BUILD_RESULT: unbound variable Change-Id: Iefbf3d6f658632990529015f35336cadb65e379c Signed-off-by: Anil Belur --- shell/job-cost.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shell/job-cost.sh b/shell/job-cost.sh index e5e18106..85096cdd 100644 --- a/shell/job-cost.sh +++ b/shell/job-cost.sh @@ -76,7 +76,7 @@ else fi # Archive the cost date -mkdir -p "$WORKSPACE/archives/cost" +mkdir -p "${WORKSPACE}/archives/cost" echo "INFO: Archiving Costs" @@ -85,5 +85,5 @@ echo "INFO: Archiving Costs" date=$(TZ=GMT date +'%Y-%m-%d %H:%M:%S') # Format the uptime, cost & stack_cost fields -printf "%s,%s,%s,%s,%d,%.2f,%.2f,%s\n" "$JOB_NAME" "$BUILD_NUMBER" "$date" \ - "$resource" "$uptime" "$cost" "$stack_cost" "$BUILD_RESULT" > "$WORKSPACE/archives/cost.csv" +printf "%s,%s,%s,%s,%d,%.2f,%.2f,%s\n" "${JOB_NAME:-}" "${BUILD_NUMBER:-}" "$date" \ + "$resource" "$uptime" "$cost" "$stack_cost" "${BUILD_RESULT:-}" > "${WORKSPACE}/archives/cost.csv" -- 2.16.6