Skip to content

Commit 8fd83ff

Browse files
Fix install script failing when version cannot be determined (#772)
Fixes #772 The install script was failing with "Checksums do not match" when the GitHub API rate limit was hit or network issues prevented retrieving the latest release version. Changes: - Add validation to check if version is empty before proceeding - Provide helpful error message explaining the issue - Suggest workaround using manual version specification - Remove redundant get_checksum_url call - Add missing ;; in get_machine function for consistency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent b7c0230 commit 8fd83ff

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

install.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ get_machine() {
5252
"i386"|"i86pc"|"x86"|"i686")
5353
echo "i386" ;;
5454
"arm64"|"armv6l"|"aarch64")
55-
echo "arm64"
55+
echo "arm64" ;;
5656
esac
5757
}
5858

@@ -63,7 +63,6 @@ get_tmp_dir() {
6363
do_checksum() {
6464
echo "Validating checksum"
6565
checksum_url=$(get_checksum_url $version)
66-
get_checksum_url $version
6766
expected_checksum=$(curl -sL $checksum_url | grep $asset_name | awk '{print $1}')
6867

6968
if command_exists sha256sum; then
@@ -124,6 +123,18 @@ main() {
124123
version=$(echo $latest_tag | sed 's/v//')
125124
fi
126125

126+
if test -z "$version"; then
127+
echo "Error: Failed to get oasdiff version."
128+
echo "This could be due to GitHub API rate limiting or network issues."
129+
echo ""
130+
echo "You can specify a version manually by setting the 'version' environment variable:"
131+
echo " curl -fsSL https://raw.githubusercontent.com/oasdiff/oasdiff/main/install.sh | version=1.11.7 sh"
132+
echo ""
133+
echo "Or install directly from a release:"
134+
echo " https://github.com/oasdiff/oasdiff/releases"
135+
exit 1
136+
fi
137+
127138
os=$(get_os)
128139
if test -z "$os"; then
129140
echo "$(uname -s) os type is not supported"

0 commit comments

Comments
 (0)