mirror of
https://github.com/fort-nix/nix-bitcoin.git
synced 2024-11-26 16:18:52 +03:00
32 lines
892 B
Bash
Executable File
32 lines
892 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Fetch hash-locked versions of assets that are dynamically fetched via
|
|
# https://github.com/mempool/mempool/blob/master/frontend/sync-assets.js
|
|
# when running `npm run build` in the frontend.
|
|
#
|
|
# This file is updated by ./frontend-assets-update.sh
|
|
|
|
declare -A revs=(
|
|
["mempool/mining-pools"]=e889230b0924d7d72eb28186db6f96ef94361fa5
|
|
["mempool/mining-pool-logos"]=9cb443035878c3f112af97384d624de245afe72d
|
|
)
|
|
|
|
fetchFile() {
|
|
repo=$1
|
|
file=$2
|
|
rev=${revs["$repo"]}
|
|
curl -fsS "https://raw.githubusercontent.com/$repo/$rev/$file"
|
|
}
|
|
|
|
fetchRepo() {
|
|
repo=$1
|
|
rev=${revs["$repo"]}
|
|
curl -fsSL "https://github.com/$repo/archive/$rev.tar.gz"
|
|
}
|
|
|
|
# shellcheck disable=SC2094
|
|
fetchFile "mempool/mining-pools" pools.json > pools.json
|
|
mkdir mining-pools
|
|
fetchRepo "mempool/mining-pool-logos" | tar xz --strip-components=1 -C mining-pools
|