1
1
mirror of https://github.com/primer/css.git synced 2024-12-29 17:12:27 +03:00

fix(selector-diff-report): always rebuild the data

This commit is contained in:
Shawn Allen 2019-02-28 15:19:53 -08:00
parent 68130d54c1
commit 8cc63dbef3

View File

@ -5,15 +5,17 @@ function log() {
echo "$@" 1>&2 echo "$@" 1>&2
} }
function warn() {
echo "$@" 1>&2
}
pkg="@primer/css" pkg="@primer/css"
path="dist/stats/primer.json" path="dist/stats/primer.json"
log "Pulling the old $path from unpkg.com..." warn "Pulling the old $path from unpkg.com..."
curl -sL "https://unpkg.com/$pkg/$path" > before.json curl -sL "https://unpkg.com/$pkg/$path" > before.json
if [[ ! -f $path ]]; then warn "Building the stats locally..."
log "Building the stats locally..." npm run dist
npm run dist
fi
cp $path after.json cp $path after.json
function list_selectors() { function list_selectors() {
@ -24,10 +26,6 @@ key=".selectors.values[]"
jq -r $key before.json > before.txt jq -r $key before.json > before.txt
jq -r $key after.json > after.txt jq -r $key after.json > after.txt
function warn() {
echo "$@" 1>&2
}
warn "[selector report] diff:" warn "[selector report] diff:"
(diff before.txt after.txt | tee selector-diff.log) || log "(no diff!)" (diff before.txt after.txt | tee selector-diff.log) || log "(no diff!)"
warn "[selector report] end" warn "[selector report] end"