Voxley / app · voxley.si / Scripts / prepare-sparkle.sh
| 1 | #!/bin/bash |
| 2 | set -euo pipefail |
| 3 | |
| 4 | version=2.10.1 |
| 5 | checksum=1a856d2a9edb8e628de88121d7be04cf0e2167f8641650b78fca00b14244cf27 |
| 6 | folder="${1:?Pass the absolute Sparkle cache directory on Expand}/sparkle-$version" |
| 7 | [[ "$folder" == /Volumes/Expand/* ]] || { echo 'Choose a Sparkle cache on Expand.' >&2; exit 1; } |
| 8 | mkdir -p "$folder" |
| 9 | archive="Sparkle-$version.tar.xz" |
| 10 | ( |
| 11 | cd "$folder" |
| 12 | if [[ ! -f "$archive" ]]; then |
| 13 | curl --fail --silent --show-error --location --retry 2 \ |
| 14 | "https://github.com/sparkle-project/Sparkle/releases/download/$version/$archive" -o "$archive.part" |
| 15 | mv "$archive.part" "$archive" |
| 16 | fi |
| 17 | printf '%s %s\n' "$checksum" "$archive" | shasum -a 256 -c >&2 |
| 18 | tar -xf "$archive" |
| 19 | ) |
| 20 | printf '%s\n' "$folder" |