From 5296d608323f2c48a6a8e588df007b22f4617010 Mon Sep 17 00:00:00 2001 From: Tim Rogers Date: Thu, 12 Sep 2024 18:53:24 +0100 Subject: [PATCH] Refactor conditions Co-authored-by: Andy Feller --- pkg/cmd/extension/manager.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/extension/manager.go b/pkg/cmd/extension/manager.go index 60fe8d239..cf5c44bcd 100644 --- a/pkg/cmd/extension/manager.go +++ b/pkg/cmd/extension/manager.go @@ -267,14 +267,14 @@ func (m *Manager) installBin(repo ghrepo.Interface, target string) error { if asset == nil && isMacARM { for _, a := range r.Assets { if strings.HasSuffix(a.Name, "darwin-amd64") { - if hasRosetta() { - asset = &a - break - } else { + if !hasRosetta() { return fmt.Errorf( "%[1]s unsupported for %[2]s. Install Rosetta with `softwareupdate --install-rosetta` to use the available darwin-amd64 binary, or open an issue: `gh issue create -R %[3]s/%[1]s -t'Support %[2]s'`", repo.RepoName(), platform, repo.RepoOwner()) } + + asset = &a + break } } }