Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix install.sh refusing to download macos-arm64 standalone. #6968

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,9 @@ npm_fallback() {
# Determine if we have standalone releases on GitHub for the system's arch.
has_standalone() {
case $ARCH in
amd64) return 0 ;;
# We only have amd64 for macOS.
arm64)
arm64) return 0 ;;
# We only have arm64 for macOS.
amd64)
[ "$(distro)" != macos ]
return
;;
Expand Down
10 changes: 5 additions & 5 deletions test/scripts/install.bats
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ function should-use-standalone() {

# macOS use homebrew but falls back to standalone when brew is unavailable then
# to npm for unsupported architectures.
@test "$SCRIPT_NAME: macos arm64 (no brew)" {
should-fallback-npm-brew "arm64"
}
@test "$SCRIPT_NAME: macos amd64 (no brew)" {
BREW_PATH= OS=macos ARCH=amd64 run "$SCRIPT" --dry-run
should-fallback-npm-brew "amd64"
}
@test "$SCRIPT_NAME: macos arm64 (no brew)" {
BREW_PATH= OS=macos ARCH=arm64 run "$SCRIPT" --dry-run
[ "$status" -eq 0 ]
[ "${lines[1]}" = "Homebrew not installed." ]
[ "${lines[2]}" = "Falling back to standalone installation." ]
[ "${lines[3]}" = "Installing v$VERSION of the amd64 release from GitHub." ]
[ "${lines[3]}" = "Installing v$VERSION of the arm64 release from GitHub." ]
[[ "${lines[-6]}" = "Standalone release has been installed"* ]]
}
@test "$SCRIPT_NAME: macos i386 (no brew)" {
Expand Down
Loading