Skip to content

Commit

Permalink
Support arm64 in install script
Browse files Browse the repository at this point in the history
The current install script always download the x86 binary even on Apple Silicon Macs. This will fix it.
  • Loading branch information
jebeaudet committed Apr 14, 2023
1 parent d0ea07a commit 6675b4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions get-latest-tgf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ install_latest_tgf () {
curl -sL "https://github.com/coveooss/tgf/releases/download/v${TGF_LATEST_VERSION}/tgf_${TGF_LATEST_VERSION}_linux_64-bits.zip" | gzip -d > ${TGF} && chmod +x ${TGF} && script_end
elif [[ $(uname -s) == Darwin ]]
then
echo 'Installing latest tgf for OSX in' $TGF_PATH '...'
curl -sL "https://github.com/coveooss/tgf/releases/download/v${TGF_LATEST_VERSION}/tgf_${TGF_LATEST_VERSION}_macOS_64-bits.zip" | bsdtar -xf- -C ${TGF_PATH} && chmod +x ${TGF} && script_end
OSX_ARCH=$(uname -m)
echo 'Installing latest tgf for OSX with arch '$OSX_ARCH' in' $TGF_PATH '...'
DOWNLOAD_URL=$([ "$OSX_ARCH" == "arm64" ] && echo "https://github.com/coveooss/tgf/releases/download/v${TGF_LATEST_VERSION}/tgf_${TGF_LATEST_VERSION}_macOS_arm64.zip" || echo "https://github.com/coveooss/tgf/releases/download/v${TGF_LATEST_VERSION}/tgf_${TGF_LATEST_VERSION}_macOS_64-bits.zip")
curl -sL $DOWNLOAD_URL | bsdtar -xf- -C ${TGF_PATH} && chmod +x ${TGF} && script_end
else
echo 'OS not supported.'
exit 1
Expand Down

0 comments on commit 6675b4f

Please sign in to comment.