aboutsummaryrefslogtreecommitdiffstats
path: root/tests/fixtures/verify-entity-download.sh
blob: 790afa0dc56ae336b2e74845ef5c2608db1d1b74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
#
# Fetches release entity mentioned in verify.csv and cache them locally.

set -e -u
set -o pipefail

API="https://api.fatcat.wiki/v0"
CSV="verify.csv"

for ident in $(awk -F, '{print $1"\n"$2}' "$CSV"); do
	if [ -f "$ident" ]; then
        >&2 echo "[cached] $ident"
		continue
	fi
	curl -sL --fail "$API/release/$ident" | jq --sort-keys . >"$ident"
done