You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

21 lines
488 B

  1. #!/usr/bin/env bash
  2. if [ -z "${NPM_TOKEN}" ]; then
  3. echo "Need to set NPM_TOKEN env variable to release node modules"
  4. exit 1
  5. fi
  6. if [ $# -eq 0 ]; then
  7. echo "No arguments provided"
  8. exit 1
  9. fi
  10. touch ~/.npmrc
  11. grep --fixed-strings --line-regexp --silent "//registry.npmjs.org/:_authToken=$NPM_TOKEN" ~/.npmrc || echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
  12. for project in $@
  13. do
  14. pushd ${project}
  15. yarn publish --non-interactive
  16. pwd
  17. popd
  18. done