From cd19545af27fa9b42218a9a619ba573f69c6b47a Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Sun, 14 Mar 2021 20:01:39 -0700 Subject: [PATCH] Add more operating systems and architectures for get_os/get_arch --- base/.local/share/buddy-up/includes/utils.sh | 22 ++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/base/.local/share/buddy-up/includes/utils.sh b/base/.local/share/buddy-up/includes/utils.sh index c386bd3..c9351db 100644 --- a/base/.local/share/buddy-up/includes/utils.sh +++ b/base/.local/share/buddy-up/includes/utils.sh @@ -13,9 +13,16 @@ must_be_root () { get_os () { case $(uname -s) in - Linux*) echo linux;; - Darwin*) echo darwin;; - *) bail "unsupported os: $(uname -s)" ;; + Linux*) echo linux;; + Darwin*) echo darwin;; + Dragonfly*) echo dragonfly;; + FreeBSD*) echo freebsd;; + NetBSD*) echo netbsd;; + OpenBSD*) echo openbsd;; + SunOS*) echo solaris;; + Windows_NT*) echo windows;; + CYGWIN_NT*) echo windows;; + *) >&2 echo "unsupported os"; return; esac } @@ -23,7 +30,14 @@ get_arch () { case $(uname -m) in x86_64*) echo amd64;; amd64*) echo amd64;; - *) bail "unsupported architecture: $(uname -m)" ;; + i386*) echo 386;; + i686*) echo 386;; + arm) echo arm;; + armv7*) echo arm;; + armv6*) echo arm;; + armv8*) echo arm;; + aarch64*) echo arm64;; + *) >&2 echo "unsupported architecture: $(uname -m)"; exit 1;; esac }