Files
tendermint/scripts/fetch-spec-protos.sh
William Banfield 47fe96c5ac wip
2021-11-16 18:16:19 -05:00

17 lines
478 B
Bash
Executable File

#!/bin/env bash
set -euo pipefail
: ${VERS:=master}
# Get shortened ref of commit
REF=$(curl -H "Accept: application/vnd.github.v3.sha" -qL \
"https://api.github.com/repos/tendermint/spec/commits/${VERS}" \
| cut -c -7)
readonly OUTDIR="tendermint-spec-${REF}"
curl -qL "https://api.github.com/repos/tendermint/spec/tarball/${REF}" | tar -xzf - ${OUTDIR}/
cp -r ${OUTDIR}/proto/tendermint/* ./proto/tendermint
cp -r ${OUTDIR}/third_party/** ./third_party
echo ${OUTDIR}