1
1
mirror of https://github.com/primer/css.git synced 2024-11-30 11:17:05 +03:00
css/script/compare-published

24 lines
710 B
Plaintext
Raw Normal View History

2017-07-13 00:33:30 +03:00
#!/bin/bash
set -e
2017-07-13 00:36:49 +03:00
# reads the tag either from $NPM_TAG or first positional arg:
# script/compare-published [tag]
tag=${1:-${NPM_TAG:-latest}}
# this is way faster than `lerna exec npm info . .name`
2017-07-13 01:04:38 +03:00
# (but will skip modules that don't have "primer-" in them)
2017-07-13 00:33:30 +03:00
modules=`ls -1 modules | egrep primer-`
2017-07-13 00:36:49 +03:00
# tabular output separator for column(1)
2017-07-13 00:33:30 +03:00
s=,
echo "📦 Comparing Primer modules published @${tag}..."
(
echo "module${s}tag${s}published${s}local"
for module in $modules; do
v_published=`npm info ${module}@${tag} .version`
v_local=`jq -Mr .version modules/${module}/package.json`
echo "${module}${s}${tag}${s}${v_published:-x}${s}${v_local}"
done
) | column -t -s=${s}