release.sh 889 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env bash
  2. # script for creating a zip and tarball for inclusion in node
  3. unset CDPATH
  4. set -e
  5. rm -rf release *.tgz || true
  6. rm node_modules/node-gyp/gyp/pylib/gyp/*.pyc || true
  7. rm node_modules/node-gyp/gyp/pylib/gyp/generator/*.pyc || true
  8. mkdir release
  9. node ./bin/npm-cli.js pack --loglevel error >/dev/null
  10. mv *.tgz release
  11. cd release
  12. tar xzf *.tgz
  13. cp ../.npmrc package/
  14. cp -r ../tap-snapshots package/
  15. cp -r ../test package/
  16. mkdir node_modules
  17. mv package node_modules/npm
  18. # make the zip for windows users
  19. cp node_modules/npm/bin/*.cmd .
  20. zipname=npm-$(node ../bin/npm-cli.js -v).zip
  21. zip -q -9 -r -X "$zipname" *.cmd node_modules
  22. # make the tar for node's deps
  23. cd node_modules
  24. tarname=npm-$(node ../../bin/npm-cli.js -v).tgz
  25. tar czf "$tarname" npm
  26. cd ..
  27. mv "node_modules/$tarname" .
  28. rm -rf *.cmd
  29. rm -rf node_modules
  30. cd ..
  31. echo "release/$tarname"
  32. echo "release/$zipname"