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}}
|
|
|
|
|
2017-10-12 07:47:54 +03:00
|
|
|
packages=$($(dirname $0)/get-packages)
|
2017-07-13 00:33:30 +03:00
|
|
|
|
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"
|
2017-10-12 07:47:54 +03:00
|
|
|
for package in $packages; do
|
|
|
|
module=$(jq -r .name "$package/package.json")
|
|
|
|
v_published=$(npm info "$module@$tag" .version)
|
|
|
|
v_local=$(jq -Mr .version "$package/package.json")
|
2017-07-13 00:33:30 +03:00
|
|
|
echo "${module}${s}${tag}${s}${v_published:-x}${s}${v_local}"
|
|
|
|
done
|
|
|
|
) | column -t -s=${s}
|