1
1
mirror of https://github.com/primer/css.git synced 2024-12-24 06:32:00 +03:00

chore: update script/selector-diff-report for reorg

This commit is contained in:
Shawn Allen 2019-02-04 12:36:07 -08:00
parent 3b65d3a4b3
commit 199a4e4d50

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -e
module=${1:-primer}
module=${1:-@primer/css}
version=${2:-latest}
function log() {
@ -12,13 +12,11 @@ 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..."
pushd modules/${module} > /dev/null
npm run build
popd > /dev/null
cp modules/${module}/build/data.json after.json
cp build/data.json after.json
function list_selectors() {
jq -r .cssstats.selectors.values[] $1 | sort
jq -r '.cssstats.selectors.values[]' $1 | sort
}
list_selectors before.json > before.txt