npm_prepublish.sh 616 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. set -e
  3. if [ "$#" != 1 ]; then
  4. echo "Please provide tag to checkout" >&2
  5. exit 1
  6. fi
  7. tag="$1"
  8. while [ "$PWD" != '/' -a ! -f moment.js ]; do
  9. cd ..
  10. done
  11. if [ ! -f moment.js ]; then
  12. echo "Run me from the moment repo" >&2
  13. exit 1
  14. fi
  15. basename=$(basename $PWD)
  16. src=moment-npm-git
  17. dest=moment-npm
  18. cd ..
  19. rm -rf $src $dest
  20. git clone $basename $src
  21. mkdir $dest
  22. cp $src/moment.js $dest
  23. cp $src/package.json $dest
  24. cp $src/README.md $dest
  25. cp $src/LICENSE $dest
  26. cp -r $src/locale $dest
  27. cp -r $src/min $dest
  28. cp $src/ender.js $dest
  29. cp $src/package.js $dest
  30. rm -rf $src
  31. echo "Check out $dest"