Branchwell

Textley / app · textley.ai / Scripts / prepare-sparkle.sh

1#!/bin/bash
2set -euo pipefail
3
4version=2.10.1
5checksum=1a856d2a9edb8e628de88121d7be04cf0e2167f8641650b78fca00b14244cf27
6folder="${1:?Pass an absolute Sparkle cache directory}/sparkle-$version"
7mkdir -p "$folder"
8archive="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)
19printf '%s\n' "$folder"