1
1
mirror of https://github.com/primer/css.git synced 2024-12-28 00:24:36 +03:00
css/script/compare-published
2019-01-07 16:03:15 -08:00

25 lines
756 B
Bash
Executable File

#!/bin/bash
set -e
# reads the tag either from $NPM_TAG or first positional arg:
# script/compare-published [tag]
tag=${1:-${NPM_TAG:-latest}}
packages=$($(dirname $0)/get-packages)
# tabular output separator for column(1)
s=,
echo "📦 Comparing Primer modules published @${tag}..."
(
echo "module${s}tag${s}published${s}local"
for package in $packages; do
module=$(jq -r .name "$package/package.json")
if [[ "$(jq -r .private $package/package.json)" != "true" ]]; then
v_published=$(npm info "$module@$tag" .version || echo '0.0.0')
v_local=$(jq -Mr .version "$package/package.json")
echo "${module}${s}${tag}${s}${v_published:-x}${s}${v_local}"
fi
done
) | column -t -s=${s}