storebound/tools/ci-tauri-tools.sh

13 lines
744 B
Bash
Executable file

#!/usr/bin/env bash
# Puts the AppImage tools Tauri's bundler would download from GitHub releases (which answer 502/504 now and then) into
# ~/.cache/tauri from our Forgejo package mirror, checked against its SHA256SUMS. Tauri skips the download when they exist.
set -eu
B="${TAURI_TOOLS_MIRROR:-https://git.crt.fyi/api/packages/CRT/generic/tauri-linux-tools/2026.11.08}"
D="$HOME/.cache/tauri"; mkdir -p "$D"; cd "$D"
curl -fsSL --retry 3 --max-time 60 -o SHA256SUMS "$B/SHA256SUMS"
while read -r sum f; do
f="${f#\*}"
if ! echo "$sum $f" | sha256sum -c --status 2>/dev/null; then curl -fsSL --retry 3 --max-time 300 -o "$f" "$B/$f"; echo "$sum $f" | sha256sum -c --status; fi
chmod +x "$f"
done < SHA256SUMS
rm -f SHA256SUMS; ls "$D"