2022-02-01 03:34:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-07-01 04:02:06 +00:00
|
|
|
TMPDIR="$(mktemp -d)"
|
2022-02-01 03:34:19 +00:00
|
|
|
|
2023-07-01 04:02:06 +00:00
|
|
|
curl -SsL https://api.github.com/repos/prusa3d/PrusaSlicer/releases/latest > $TMPDIR/latest.json
|
2022-02-01 03:34:19 +00:00
|
|
|
|
2024-04-03 20:28:42 +00:00
|
|
|
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)
|
2023-07-01 04:02:06 +00:00
|
|
|
version=$(jq -r .tag_name $TMPDIR/latest.json)
|
2022-02-01 03:34:19 +00:00
|
|
|
|
2023-07-01 04:02:06 +00:00
|
|
|
if [ $# -ne 1 ]; then
|
|
|
|
echo "Wrong number of params"
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
request=$1
|
2022-02-01 03:34:19 +00:00
|
|
|
fi
|
|
|
|
|
2023-07-01 04:02:06 +00:00
|
|
|
case $request in
|
2022-02-01 03:34:19 +00:00
|
|
|
|
2023-07-01 04:02:06 +00:00
|
|
|
url)
|
|
|
|
echo $url
|
|
|
|
;;
|
2022-02-01 03:34:19 +00:00
|
|
|
|
2023-07-01 04:02:06 +00:00
|
|
|
name)
|
|
|
|
echo $name
|
|
|
|
;;
|
2022-02-01 03:34:19 +00:00
|
|
|
|
2023-07-01 04:02:06 +00:00
|
|
|
version)
|
|
|
|
echo $version
|
|
|
|
;;
|
2022-02-01 03:34:19 +00:00
|
|
|
|
2023-07-01 04:02:06 +00:00
|
|
|
*)
|
|
|
|
echo "Unknown request"
|
|
|
|
;;
|
|
|
|
esac
|
2022-02-01 03:34:19 +00:00
|
|
|
|
2023-07-01 04:02:06 +00:00
|
|
|
exit 0
|