Skip to content

Commit 1880ace

Browse files
Fix install.sh version detection when no latest release exists
When no releases are tagged as latest, the GitHub redirect URL lacks a /tag/ segment, so the sed substitution is a no-op and $VERSION gets set to the full URL rather than being empty. Validate that $VERSION matches a semver pattern instead of just checking for empty. Fixes #36 Co-Authored-By: Cassondra <1840295+castastrophe@users.noreply.github.com>
1 parent 6085da2 commit 1880ace

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ esac
2323
# Fetch latest version
2424
echo "Fetching latest version..."
2525
VERSION=$(curl -sI "https://github.com/$REPO/releases/latest" | grep -i '^location:' | sed 's/.*tag\///' | tr -d '\r\n')
26-
if [ -z "$VERSION" ]; then
26+
if ! [[ "$VERSION" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+ ]]; then
2727
echo "Failed to determine latest version"
2828
exit 1
2929
fi

0 commit comments

Comments
 (0)