Skip to content

Commit

Permalink
fix: improve run script
Browse files Browse the repository at this point in the history
- if `VERSION` ends with `-pro`, set `DISTRIBUTION` to `pro`
- if `DISTRIBUTION` is `pro`, and `VERSION` does not have the `-pro`
  suffix, add it

closes #4374
  • Loading branch information
caarlos0 committed Oct 26, 2023
1 parent b233c68 commit de1c52b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions www/docs/install.md
Expand Up @@ -205,6 +205,9 @@ Once you do that, you can install the packages.
```bash
curl -sfL https://goreleaser.com/static/run |
VERSION=__VERSION__ DISTRIBUTION=oss bash -s -- check

curl -sfL https://goreleaser.com/static/run |
VERSION=__VERSION__ DISTRIBUTION=pro bash -s -- check
```

!!! tip
Expand Down
11 changes: 10 additions & 1 deletion www/docs/static/run
@@ -1,6 +1,10 @@
#!/bin/sh
#!/bin/bash
set -e

if [[ "$VERSION" == *-pro ]]; then
DISTRIBUTION="pro"
fi

if test "$DISTRIBUTION" = "pro"; then
echo "Using Pro distribution..."
RELEASES_URL="https://github.com/goreleaser/goreleaser-pro/releases"
Expand All @@ -20,9 +24,14 @@ test -z "$VERSION" && {
exit 1
}

if test "$DISTRIBUTION" = "pro" && [[ "$VERSION" != *-pro ]]; then
VERSION="$VERSION-pro"
fi

TMP_DIR="$(mktemp -d)"
# shellcheck disable=SC2064 # intentionally expands here
trap "rm -rf \"$TMP_DIR\"" EXIT INT TERM

OS="$(uname -s)"
ARCH="$(uname -m)"
test "$ARCH" = "aarch64" && ARCH="arm64"
Expand Down

0 comments on commit de1c52b

Please sign in to comment.