From b3fbc1d6e9daa94bb383ef7580257ae1f06af3f4 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Sun, 9 Jun 2019 14:54:12 -0400 Subject: [PATCH] Default to amd64 if uname -m fails --- main.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 03db3a3..f42f6c3 100644 --- a/main.go +++ b/main.go @@ -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 ( @@ -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 (