Skip to content

Commit

Permalink
cmd/upgrade: amd64 should fallback to x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
joshi4 committed Jun 4, 2024
1 parent 98d8194 commit 271f0e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/getsavvyinc/savvy-cli/config"
"github.com/getsavvyinc/savvy-cli/display"
"github.com/getsavvyinc/upgrade-cli"
"github.com/getsavvyinc/upgrade-cli/release/asset"
"github.com/spf13/cobra"
)

Expand All @@ -26,7 +27,10 @@ var upgradeCmd = &cobra.Command{
}
version := config.Version()

upgrader := upgrade.NewUpgrader(owner, repo, executablePath)
assetDownloader := asset.NewAssetDownloader(executablePath, asset.WithLookupArchFallback(map[string]string{
"amd64": "x86_64",
}))
upgrader := upgrade.NewUpgrader(owner, repo, executablePath, upgrade.WithAssetDownloader(assetDownloader))

if ok, err := upgrader.IsNewVersionAvailable(context.Background(), version); err != nil {
display.Error(err)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/charmbracelet/huh/spinner v0.0.0-20240306161957-71f31c155b08
github.com/charmbracelet/lipgloss v0.9.1
github.com/creack/pty v1.1.21
github.com/getsavvyinc/upgrade-cli v0.3.0
github.com/getsavvyinc/upgrade-cli v0.4.0
github.com/muesli/cancelreader v0.2.2
github.com/muesli/termenv v0.15.2
github.com/spf13/cobra v1.8.0
Expand All @@ -28,7 +28,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
github.com/getsavvyinc/upgrade-cli v0.3.0 h1:DePUza5nBTsoqCSZNqvz5IhRylHq/+oEKTpEqs7ngv0=
github.com/getsavvyinc/upgrade-cli v0.3.0/go.mod h1:Ert9guX/QneZS/noA8Ud0ggjXPLr1OOXmtxeX66xCwo=
github.com/getsavvyinc/upgrade-cli v0.4.0 h1:ljV62fwBjd1r98i1CFd2eoyrjT3XtpTSq2N3Rjr7798=
github.com/getsavvyinc/upgrade-cli v0.4.0/go.mod h1:Ert9guX/QneZS/noA8Ud0ggjXPLr1OOXmtxeX66xCwo=
github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
Expand Down

0 comments on commit 271f0e0

Please sign in to comment.