prusaslicer-novnc/get_latest_prusaslicer_release.sh
vajonam 2747747d37 feat: test moving to GTK3. Looks much more modern
Signed-off-by: vajonam <152501+vajonam@users.noreply.github.com>
2024-04-03 16:28:42 -04:00

38 lines
695 B
Bash
Executable File

#!/bin/bash
TMPDIR="$(mktemp -d)"
curl -SsL https://api.github.com/repos/prusa3d/PrusaSlicer/releases/latest > $TMPDIR/latest.json
url=$(jq -r '.assets[] | select(.browser_download_url|test("linux-x64-(?!GTK2).+.tar.bz2$"))| .browser_download_url' $TMPDIR/latest.json)
name=$(jq -r '.assets[] | select(.browser_download_url|test("linux-x64-(?!GTK2).+.tar.bz2$"))| .name' $TMPDIR/latest.json)
version=$(jq -r .tag_name $TMPDIR/latest.json)
if [ $# -ne 1 ]; then
echo "Wrong number of params"
exit 1
else
request=$1
fi
case $request in
url)
echo $url
;;
name)
echo $name
;;
version)
echo $version
;;
*)
echo "Unknown request"
;;
esac
exit 0