2019-01-24 02:31:51 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
function log() {
|
2019-04-26 23:11:08 +03:00
|
|
|
echo "$@" 1>&2
|
2019-01-24 02:31:51 +03:00
|
|
|
}
|
|
|
|
|
2019-03-01 02:19:53 +03:00
|
|
|
function warn() {
|
2019-04-26 23:11:08 +03:00
|
|
|
echo "$@" 1>&2
|
2019-03-01 02:19:53 +03:00
|
|
|
}
|
|
|
|
|
2019-03-01 00:33:56 +03:00
|
|
|
pkg="@primer/css"
|
|
|
|
path="dist/stats/primer.json"
|
2019-03-01 02:19:53 +03:00
|
|
|
warn "Pulling the old $path from unpkg.com..."
|
2019-03-01 00:33:56 +03:00
|
|
|
curl -sL "https://unpkg.com/$pkg/$path" > before.json
|
2019-01-24 02:31:51 +03:00
|
|
|
|
2019-03-01 02:19:53 +03:00
|
|
|
warn "Building the stats locally..."
|
2019-03-01 00:33:56 +03:00
|
|
|
cp $path after.json
|
2019-01-24 02:31:51 +03:00
|
|
|
|
2019-03-01 00:33:56 +03:00
|
|
|
key=".selectors.values[]"
|
|
|
|
jq -r $key before.json > before.txt
|
|
|
|
jq -r $key after.json > after.txt
|
2019-01-24 02:31:51 +03:00
|
|
|
|
2019-04-26 23:22:14 +03:00
|
|
|
diff {before,after}.txt && echo 'no diff!'
|
2019-02-12 08:33:07 +03:00
|
|
|
|
2019-01-24 02:31:51 +03:00
|
|
|
rm {before,after}.{json,txt}
|