#!/bin/bash set -e module=${1:-@primer/css} version=${2:-latest} function log() { echo "$@" 1>&2 } log "Pulling the latest ${module}/build/data.json ..." curl -sL "https://unpkg.com/${module}@${version}/build/data.json" > before.json log "Building ${module}/build/data.json locally..." npm run build cp build/data.json after.json function list_selectors() { jq -r '.cssstats.selectors.values[]' $1 | sort } list_selectors before.json > before.txt list_selectors after.json > after.txt diff before.txt after.txt && log "(no diff!)" rm {before,after}.{json,txt}