Skip to content

Commit

Permalink
Add ARM support for upgrade mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
godwhoa committed Dec 7, 2018
1 parent aa51471 commit 5a4c6c6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"os"
"os/exec"
"runtime"
)

type Release struct {
Expand All @@ -32,10 +33,15 @@ func fetchRelease() (*Release, error) {
return release, json.Unmarshal(body, release)
}

var archAsset = map[string]string{
"amd64": "oodle_linux",
"arm": "oodle_linux_armv7",
}

// Extracts asset download url
func extractAsset(r *Release) (string, error) {
for _, asset := range r.Assets {
if asset.Name == "oodle_linux" {
if asset.Name == archAsset[runtime.GOARCH] {
return asset.BrowserDownloadURL, nil
}
}
Expand Down

0 comments on commit 5a4c6c6

Please sign in to comment.