This repository has been archived on 2022-02-20. You can view files and clone it, but cannot push or open issues/pull-requests.
bash-shell-host/all/modules/machine.sh

41 lines
625 B
Bash

#!/bin/bash
function get_platform () {
local OS
local ARCH
local PLATFORM
OS="$(uname -s)"
ARCH="$(uname -m)"
case $OS in
"Linux")
case $ARCH in
"x86_64")
ARCH=amd64
;;
"aarch64")
ARCH=arm64
;;
"armv6")
ARCH=armv6l
;;
"armv8")
ARCH=arm64
;;
.*386.*)
ARCH=386
;;
esac
PLATFORM="linux-$ARCH"
;;
"Darwin")
PLATFORM="darwin-amd64"
;;
esac
echo $PLATFORM
}