Skip to content

Commit

Permalink
fix: fix CIRCLE_WORKING_DIRECTORY unexpanded ~ (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankorstore-haddowg authored Mar 15, 2023
1 parent 03e3809 commit b520a2d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/scripts/get-job-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit b520a2d

Please sign in to comment.