From 44f4a02cf7a93db1bb8dfd34c2ca2e61fd3886ea Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 8 Aug 2024 12:49:56 -0700 Subject: [PATCH] download artifacts to script dir --- scripts/artifacts/download-staged-artifact.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/artifacts/download-staged-artifact.sh b/scripts/artifacts/download-staged-artifact.sh index 7f9b10c75..6ae391e5e 100755 --- a/scripts/artifacts/download-staged-artifact.sh +++ b/scripts/artifacts/download-staged-artifact.sh @@ -1,16 +1,21 @@ +#!/bin/bash + # Downloads the artifacts for the specified version from the staging bucket for local testing. # Usage: download-staged-artifact.sh # Example: download-staged-artifact.sh 0.1.0 - # Retrieve version from the first argument + VERSION=$1 if [ -z "$VERSION" ]; then echo "Usage: $0 " exit fi +# Gets the directory of the script +SCRIPT_DIR=$(dirname $0) + # Download the artifacts for the specified version from the staging bucket -DOWNLOAD_DIR=$VERSION-staged +DOWNLOAD_DIR=$SCRIPT_DIR/$VERSION-staged rm -rf $DOWNLOAD_DIR mkdir -p $DOWNLOAD_DIR aws s3 cp s3://waveterm-github-artifacts/staging-w2/$VERSION/ $DOWNLOAD_DIR/ --recursive --profile $AWS_PROFILE