Skip to content

Commit

Permalink
fix arch
Browse files Browse the repository at this point in the history
  • Loading branch information
nsaputro-shell committed Jan 3, 2024
1 parent b48cbda commit a9080f5
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ download_release() {
local version="$1"
local filename="$2"
local platform="$(get_platform)"
local arch="$(get_arch)"
local arch="$(get_platform)"

local url="$GH_REPO/releases/download/v${version}/monaco-${arch}-${platform}"
local url="$GH_REPO/releases/download/v${version}/monaco-${platform}-${arch}"

echo $url

Expand All @@ -48,6 +48,30 @@ download_release() {
chmod +x "$filename"
}

get_platform() {
local -r kernel="$(uname -s)"
if [[ ${OSTYPE} == "msys" || ${kernel} == "CYGWIN"* || ${kernel} == "MINGW"* ]]; then
echo windows
else
uname | tr '[:upper:]' '[:lower:]'
fi
}

get_arch() {
local arch
arch=$(uname -m)
if [[ ${arch} == "arm64" ]] || [[ ${arch} == "aarch64" ]]; then
echo "arm64"
elif [[ ${arch} == *"arm"* ]] || [[ ${arch} == *"aarch"* ]]; then
echo "arm"
elif [[ ${arch} == *"386"* ]]; then
echo "386"
else
echo "amd64"
fi
}


install_version() {
local install_type="$1"
local version="$2"
Expand Down

0 comments on commit a9080f5

Please sign in to comment.