#!/bin/bash

set -e

VERSION="1.5.0"
SRC="https://cdn.jsdelivr.net/npm/@radiantearth/stac-fields@$VERSION/fields-normalized.json"
HERE=$(dirname "$0")
DEST=$(dirname "$HERE")/core/pystac/static/fields-normalized.json

echo "Pulling fields-normalized.json from cdn to $DEST"
curl "$SRC" | jq -c '{metadata: .metadata}' > "$DEST"
