Преглед на файлове

Add more checks to release script

- Check that the registry is configured correctly.
- Check that we are signed in.

These are both things that may fail if the local verdaccio registry was
recently used.
Renée Kooi преди 6 години
родител
ревизия
26f11dd695
променени са 1 файла, в които са добавени 13 реда и са изтрити 0 реда
  1. 13 0
      bin/release

+ 13 - 0
bin/release

@@ -17,6 +17,19 @@ if [[ ! "$@" =~ -y ]]; then
   read
 fi
 
+if [[ ! "$(npm get registry)" =~ https://registry\.npmjs\.(com|org)/? ]]; then
+  echo "Found unexpected npm registry: $(npm get registry)"
+  echo "Run this to fix:"
+  echo "npm set registry https://registry.npmjs.org"
+  exit 1
+fi
+
+if ! npm whoami > /dev/null; then
+  echo "Not authenticated with npm. First do:"
+  echo "npm login"
+  exit 1
+fi
+
 set -o xtrace
 
 # Update README before publishing `uppy`