Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. # npm publish with goodies
  2. # prerequisites:
  3. # `npm install -g trash conventional-recommended-bump conventional-changelog conventional-github-releaser conventional-commits-detector json`
  4. # `np` with optional argument `patch`/`minor`/`major`/`<version>`
  5. # defaults to conventional-recommended-bump
  6. # and optional argument preset `angular`/ `jquery` ...
  7. # defaults to conventional-commits-detector
  8. np() {
  9. travis status --no-interactive &&
  10. trash node_modules &>/dev/null;
  11. git pull --rebase &&
  12. npm install &&
  13. npm test &&
  14. cp package.json _package.json &&
  15. preset=`conventional-commits-detector` &&
  16. echo $preset &&
  17. bump=`conventional-recommended-bump -p angular` &&
  18. echo ${1:-$bump} &&
  19. npm --no-git-tag-version version ${1:-$bump} &>/dev/null &&
  20. conventional-changelog -i CHANGELOG.md -s -p ${2:-$preset} &&
  21. git add CHANGELOG.md &&
  22. version=`cat package.json | json version` &&
  23. git commit -m"docs(CHANGELOG): $version" &&
  24. mv -f _package.json package.json &&
  25. npm version ${1:-$bump} -m "chore(release): %s" &&
  26. git push --follow-tags &&
  27. conventional-github-releaser -p ${2:-$preset} &&
  28. npm publish
  29. }
  30.  
  31. # apm publish with goodies
  32. ap() {
  33. travis status --no-interactive &&
  34. trash node_modules &>/dev/null;
  35. git pull --rebase &&
  36. npm install &&
  37. apm install &&
  38. npm test && # checking coding styles or non atom related tests maybe
  39. apm test &&
  40. cp package.json _package.json &&
  41. preset=`conventional-commits-detector` &&
  42. echo $preset &&
  43. bump=`conventional-recommended-bump -p angular` &&
  44. echo ${1:-$bump} &&
  45. npm --no-git-tag-version version ${1:-$bump} &>/dev/null &&
  46. conventional-changelog -i CHANGELOG.md -s -p ${2:-$preset} &&
  47. git add CHANGELOG.md &&
  48. version=`cat package.json | json version` &&
  49. git commit -m":memo: CHANGELOG for $version" &&
  50. mv -f _package.json package.json &&
  51. apm publish ${1:-$bump} &&
  52. git push --follow-tags &&
  53. conventional-github-releaser -p ${2:-$preset}
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement