Skip to content

Commit

Permalink
Use $RUNNER_TEMP to store binary
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed Jun 12, 2024
1 parent f84daf2 commit ca1e169
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions setup_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

set -euo pipefail

if test -d .bin; then
echo "Directory .bin found; assuming CLI was already downloaded"
exit 0
fi

# Pull latest version from VERSION file if not set.
if [ -z "${VERSION:-}" ]; then
VERSION=$(cat "$(dirname "$0")"/VERSION)
Expand Down Expand Up @@ -43,6 +38,9 @@ ARM64)
;;
esac

# Change into temporary directory.
cd "$RUNNER_TEMP"

# Download release archive.
curl -L -s -O "https://github.com/databricks/cli/releases/download/v${VERSION}/${FILE}.zip"

Expand Down
8 changes: 3 additions & 5 deletions setup_snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ function cli_snapshot_directory() {
echo $dir
}

if test -d .bin; then
echo "Directory .bin found; assuming CLI was already downloaded"
exit 0
fi

# Default to main branch if branch is not specified.
if [ -z "$BRANCH" ]; then
BRANCH=main
Expand Down Expand Up @@ -71,6 +66,9 @@ macOS)
;;
esac

# Change into temporary directory.
cd "$RUNNER_TEMP"

gh run download "$last_successful_run_id" -n "$artifact" -D .bin

dir="$PWD/.bin/$(cli_snapshot_directory)"
Expand Down

0 comments on commit ca1e169

Please sign in to comment.