cdnjs-commit.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env bash
  2. cd "`dirname $0`/.."
  3. echo
  4. echo "This script assumes the following:"
  5. echo "1. You have run the release script"
  6. echo "2. You have a clone of CDNJS's repo with remotes 'upstream' and 'origin'"
  7. echo "3. You have initialized CDNJS's repo with 'npm install'"
  8. echo
  9. # 1. make a fork of cdnjs on github
  10. # 2. clone the fork from github (which will be the 'origin')
  11. # 3. `git remote add upstream [email protected]:cdnjs/cdnjs.git`
  12. version=$(sed -n 's/^.*"version" *: *"\([^"]*\)".*$/\1/p' package.json)
  13. cdnjs_dir="$HOME/Scratch/cdnjs"
  14. echo "FullCalendar version: $version"
  15. echo "Default CDNJS directory: $cdnjs_dir"
  16. echo
  17. echo "Enter the location of the CDNJS directory. To keep the default, press enter."
  18. read cdnjs_dir_override
  19. if [[ "$cdnjs_dir_override" ]]
  20. then
  21. cdnjs_dir="$cdnjs_dir_override"
  22. fi
  23. cp -r -f dist/cdnjs/* "$cdnjs_dir/ajax/libs/fullcalendar" && \
  24. cd $cdnjs_dir && \
  25. npm test && \
  26. git add "ajax/libs/fullcalendar" && \
  27. git commit -e -m "fullcalendar v$version" && \
  28. echo && \
  29. echo 'Pulling from upstream...' && \
  30. git pull --rebase upstream master && \
  31. echo && \
  32. echo 'DONE. It is now up to you to run `'"cd $cdnjs_dir && git push origin master"'` and submit the PR to CDNJS.' && \
  33. echo