Skip to content

Commit

Permalink
Default to amd64 if uname -m fails
Browse files Browse the repository at this point in the history
  • Loading branch information
jrick committed Jun 9, 2019
1 parent de9bef8 commit b3fbc1d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This code is available on the terms of the project LICENSE.md file,
// also available online at https://blueoakcouncil.org/license/1.0.0.

package main

import (
Expand Down Expand Up @@ -30,16 +33,12 @@ func installurl() string {
}

func machine() string {
arch := "amd64"
cmd := exec.Command("uname", "-m")
output, err := cmd.Output()
if err != nil {
err := err.(*exec.ExitError)
os.Stderr.Write(err.Stderr)
os.Exit(err.ExitCode())
return "amd64"
}
arch = string(output[:len(output)-1]) // remove newline
return arch
return string(output[:len(output)-1]) // remove newline
}

var (
Expand Down

0 comments on commit b3fbc1d

Please sign in to comment.