check-npm-package-scopes.sh 419 B

1234567891011
  1. #!/usr/bin/env bash
  2. # This script checks to ensure that all our NPM packages have an appropriate scope.
  3. #
  4. git ls-files -z | grep -z "package.json" | xargs -n1 -r -0 /bin/bash -c 'printf "[$@]"; jq ".name" "$@";' '' | egrep -v "^\[.*\]null$" | egrep -v '^\[.*\]"(@certusone/|@wormhole-foundation/)'
  5. if [ $? -eq 0 ]; then
  6. echo "[!] Unscoped npm packages" >&2
  7. exit 1
  8. else
  9. echo "[+] No unscoped npm packages"
  10. fi