Skip to content

Commit dbe70da

Browse files
authored
Install the latest release by default (#301)
1 parent a5a3ab7 commit dbe70da

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

MAINTAINERS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ The GitHub workflow will fail initially because the jobs which test the installe
3333
Releasing a new version is a three-step process:
3434

3535
1. Bump the version in `[file:Cargo.toml]`, run `cargo build` to update `[file:Cargo.lock]`, and update `[file:CHANGELOG.md]` with information about the new version. Ship those changes as a single commit.
36-
2. Once the GitHub workflow has finished on the `main` branch, update the version in `[file:install.sh]` to point to the new release. Also, update the `rev` in the example pre-commit configuration in `[file:README.md]` to point to the new version.
36+
2. Once the GitHub workflow has finished on the `main` branch, the installation script will begin installing the new release by default. Update the `rev` in the example pre-commit configuration in `[file:README.md]` to point to the new version.
3737
3. Create a pull request in the `Homebrew/homebrew-core` repository on GitHub to bump the version in [this file](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/t/tagref.rb).

install.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
# Where the binary will be installed
1414
DESTINATION="${PREFIX:-/usr/local/bin}/tagref"
1515

16-
# Which version to download
17-
RELEASE="v${VERSION:-1.13.0}"
18-
1916
# Determine which binary to download.
2017
FILENAME=''
2118
if uname -a | grep -qi 'x86_64.*GNU/Linux'; then
@@ -56,10 +53,15 @@
5653
# Compute the full file path.
5754
SOURCE="$TEMPDIR/$FILENAME"
5855

56+
# Download the requested version, or the latest published version by default.
57+
if [ -n "${VERSION:-}" ]; then
58+
DOWNLOAD_URL="https://github.com/stepchowfun/tagref/releases/download/v$VERSION/$FILENAME"
59+
else
60+
DOWNLOAD_URL="https://github.com/stepchowfun/tagref/releases/latest/download/$FILENAME"
61+
fi
62+
5963
# Download the binary.
60-
curl \
61-
"https://github.com/stepchowfun/tagref/releases/download/$RELEASE/$FILENAME" \
62-
-o "$SOURCE" -LSf || fail 'There was an error downloading the binary.'
64+
curl "$DOWNLOAD_URL" -o "$SOURCE" -LSf || fail 'There was an error downloading the binary.'
6365

6466
# Make it executable.
6567
chmod a+x "$SOURCE" || fail 'There was an error setting the permissions for the binary.'

0 commit comments

Comments
 (0)