Skip to content

Commit

Permalink
feat: use amd64 restic for arm64 Windows (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmaguire authored Apr 6, 2024
1 parent 7017c3d commit 3770966
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/resticinstaller/resticinstaller.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ func resticBinName() string {

func resticDownloadURL(version string) string {
if runtime.GOOS == "windows" {
return fmt.Sprintf("https://github.com/restic/restic/releases/download/v%v/restic_%v_windows_%v.zip", version, version, runtime.GOARCH)
// restic is only built for 386 and amd64 on Windows, default to amd64 for other platforms (e.g. arm64.)
arch := "amd64"
if runtime.GOARCH == "386" || runtime.GOARCH == "amd64" {
arch = runtime.GOARCH
}
return fmt.Sprintf("https://github.com/restic/restic/releases/download/v%v/restic_%v_windows_%v.zip", version, version, arch)
}
return fmt.Sprintf("https://github.com/restic/restic/releases/download/v%v/restic_%v_%v_%v.bz2", version, version, runtime.GOOS, runtime.GOARCH)
}
Expand Down

0 comments on commit 3770966

Please sign in to comment.