From b520a2d4ea5b23ffb68ed4e9158d91bef5caf3cc Mon Sep 17 00:00:00 2001 From: Gregory Haddow <93638800+ankorstore-haddowg@users.noreply.github.com> Date: Wed, 15 Mar 2023 09:58:34 +0000 Subject: [PATCH] fix: fix CIRCLE_WORKING_DIRECTORY unexpanded ~ (#22) --- src/scripts/get-job-artifacts.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/scripts/get-job-artifacts.sh b/src/scripts/get-job-artifacts.sh index f2e073e..0ecb71f 100755 --- a/src/scripts/get-job-artifacts.sh +++ b/src/scripts/get-job-artifacts.sh @@ -11,6 +11,9 @@ if [ -z "$CIRCLE_TOKEN" ]; then exit 1; fi +# fix unexpanded ~ in CIRCLE_WORKING_DIRECTORY +CIRCLE_WORKING_DIRECTORY="${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}" + mkdir -p /tmp/aks WORKFLOW_JOBS_JSON=/tmp/aks/current_wf_jobs.json @@ -63,10 +66,10 @@ get_artifacts_for_job() { } if [ -n "$TARGET_PATH" ]; then - TARGET_PATH="$(realpath "$CIRCLE_WORKING_DIRECTORY/$TARGET_PATH")" + TARGET_PATH="$CIRCLE_WORKING_DIRECTORY/$TARGET_PATH" mkdir -p "$TARGET_PATH" else - TARGET_PATH="$(realpath "$CIRCLE_WORKING_DIRECTORY")" + TARGET_PATH="$CIRCLE_WORKING_DIRECTORY" fi echo "Downloading artifact(s) from job(s): $JOB_LIST"