Branchwell

Voxley / app · voxley.si / Scripts / prepare-sparkle.sh

Raw 748 B on 65820bdbf93f3277c3f8b2c09a8acbcf3783d60a
1#!/bin/bash
2set -euo pipefail
3
4version=2.10.1
5checksum=1a856d2a9edb8e628de88121d7be04cf0e2167f8641650b78fca00b14244cf27
6folder="${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; }
8mkdir -p "$folder"
9archive="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)
20printf '%s\n' "$folder"