1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-04 03:11:55 +02:00

Merge pull request from GHSA-2fvp-53hw-f9fc

Also takes care of removing the temporary directory when done.

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Ville Skyttä 2023-06-15 17:45:14 +03:00 committed by GitHub
parent b6e9eb81e4
commit 265148c661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
www/docs/static/run vendored
View File

@ -20,11 +20,13 @@ test -z "$VERSION" && {
exit 1
}
test -z "$TMPDIR" && TMPDIR="$(mktemp -d)"
export TAR_FILE="$TMPDIR/${FILE_BASENAME}_$(uname -s)_$(uname -m).tar.gz"
TMP_DIR="$(mktemp -d)"
# shellcheck disable=SC2064 # intentionally expands here
trap "rm -rf \"$TMP_DIR\"" EXIT
export TAR_FILE="$TMP_DIR/${FILE_BASENAME}_$(uname -s)_$(uname -m).tar.gz"
(
cd "$TMPDIR"
cd "$TMP_DIR"
echo "Downloading GoReleaser $VERSION..."
curl -sfLo "$TAR_FILE" \
"$RELEASES_URL/download/$VERSION/${FILE_BASENAME}_$(uname -s)_$(uname -m).tar.gz"
@ -44,6 +46,5 @@ export TAR_FILE="$TMPDIR/${FILE_BASENAME}_$(uname -s)_$(uname -m).tar.gz"
fi
)
tar -xf "$TAR_FILE" -C "$TMPDIR"
"${TMPDIR}/goreleaser" "$@"
tar -xf "$TAR_FILE" -C "$TMP_DIR"
"$TMP_DIR/goreleaser" "$@"