From 33319a00efa8b36aaef2f48293605e8c9e3d712c Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Mon, 26 Apr 2021 13:15:58 +0200 Subject: [PATCH] add arm for darwin --- build/build.go | 2 +- install.sh | 4 +++- internal/bins/bins.go | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build/build.go b/build/build.go index f5af1db..a688eb1 100644 --- a/build/build.go +++ b/build/build.go @@ -16,7 +16,7 @@ import ( var DIR, _ = filepath.Abs("./dist") var targets = map[string][]string{ - "darwin": {"amd64"}, + "darwin": {"amd64", "arm64"}, "freebsd": {"386", "amd64", "arm"}, "linux": {"386", "amd64", "arm", "arm64"}, "netbsd": {"386", "amd64"}, diff --git a/install.sh b/install.sh index a449739..f176b86 100755 --- a/install.sh +++ b/install.sh @@ -16,9 +16,11 @@ else fi echo $OS -NATIVE_ARCH=$(uname -m) +NATIVE_ARCH=$(uname -m | tr '[:upper:]' '[:lower:]') if [[ $NATIVE_ARCH == *"x86_64"* ]]; then ARCH=amd64 +elif [[ $NATIVE_ARCH == *"arm64"* || $NATIVE_ARCH == *"aarch64"* ]]; then + ARCH=arm64 elif [[ $NATIVE_ARCH == *"x86"* ]]; then ARCH=386 else diff --git a/internal/bins/bins.go b/internal/bins/bins.go index ac40d2a..87e9488 100644 --- a/internal/bins/bins.go +++ b/internal/bins/bins.go @@ -120,7 +120,9 @@ func upgradeRestic() error { func Upgrade(restic bool) error { // Upgrade restic if restic { - InstallRestic() + if err := InstallRestic(); err != nil { + colors.Error.Println(err) + } upgradeRestic() }