Skip to content

Commit

Permalink
Update setup URLs. (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch authored Nov 7, 2024
1 parent 08db7d3 commit e105c15
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions cmd/jag/commands/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,36 @@ import (

func getToitSDKURL(version string) (string, error) {
currOS := runtime.GOOS
currARCH := runtime.GOARCH
selector := ""
if currOS == "darwin" {
currOS = "macos"
} else {
currARCH := runtime.GOARCH
if currARCH == "arm" {
currOS = "rpi"
if currARCH == "amd64" {
selector = "macos-x64"
} else if currARCH == "arm64" {
selector = "macos-aarch64"
} else {
return "", fmt.Errorf("unsupported architecture %s for macOS", currARCH)
}
} else if currOS == "linux" {
if currARCH == "amd64" {
selector = "linux-x64"
} else if currARCH == "arm" {
selector = "linux-armv7"
} else if currARCH == "arm64" {
currOS = "aarch64"
selector = "linux-aarch64"
} else {
return "", fmt.Errorf("unsupported architecture %s for Linux", currARCH)
}
} else if currOS == "windows" {
if currARCH == "amd64" {
selector = "windows-x64"
} else {
return "", fmt.Errorf("unsupported architecture %s for Windows", currARCH)
}
} else {
return "", fmt.Errorf("unsupported OS %s", currOS)
}
return fmt.Sprintf("https://github.com/toitlang/toit/releases/download/%s/toit-%s.tar.gz", version, currOS), nil
return fmt.Sprintf("https://github.com/toitlang/toit/releases/download/%s/toit-%s.tar.gz", version, selector), nil
}

func getAssetsURL(version string) string {
Expand Down

0 comments on commit e105c15

Please sign in to comment.