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