-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-new-hashes.sh
More file actions
executable file
·36 lines (28 loc) · 936 Bytes
/
get-new-hashes.sh
File metadata and controls
executable file
·36 lines (28 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Check if version argument is provided
if [ -z "$1" ]; then
echo "Usage: $0 <version>"
echo "Example: $0 v1.2.4"
exit 1
fi
VERSION=$1
BASE_URL="https://github.com/interline-io/transitland-lib/releases/download/${VERSION}"
# Create a temporary directory
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"
echo "Downloading files for version ${VERSION}..."
# Download and calculate hash for macOS Intel
echo "macOS Intel:"
curl -L "${BASE_URL}/transitland-macos-intel" -o transitland-macos-intel
sha256sum transitland-macos-intel
# Download and calculate hash for macOS Apple Silicon
echo -e "\nmacOS Apple Silicon:"
curl -L "${BASE_URL}/transitland-macos-apple" -o transitland-macos-apple
sha256sum transitland-macos-apple
# Download and calculate hash for Linux
echo -e "\nLinux:"
curl -L "${BASE_URL}/transitland-linux" -o transitland-linux
sha256sum transitland-linux
# Clean up
cd - > /dev/null
rm -rf "$TEMP_DIR"