Skip to content

Commit

Permalink
Add support for macOS OS and arm arch
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoBrigitte committed Dec 1, 2024
1 parent f9f0ebf commit 89537c9
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,20 @@ install_tool() {
}

install_tools() {
install_tool "${JQ_BIN}" "${JQ_VERSION}" "https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64"
os=""
case "$OSTYPE" in
darwin*) os="macos" ;;
linux*) os="linux" ;;
*) echo "unsupported OS: $OSTYPE"; exit ;;
esac

arch=""
case "$(uname -m)" in
x86_64) arch="amd64" ;;
arm*) arch="arm64" ;;
aarch*) arch="arm64" ;;
*) echo "unsupported architecture: $(uname -m)"; exit ;;
esac

install_tool "${JQ_BIN}" "${JQ_VERSION}" "https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-${os}-${arch}"
}

0 comments on commit 89537c9

Please sign in to comment.