#!/bin/bash set -e # pwd package=$(jq .name package.json) version=$(jq .version package.json) published=$(npm info "$package@$version") if [[ "$version" = "$published" ]]; then echo "⚠️ $package@$version is already published!" else echo "📦 npm publish: $package@$version" npm publish $@ fi