update-changelog.sh 377 B

123456789101112131415161718192021
  1. #! /usr/bin/env bash
  2. set -euo pipefail
  3. # To make it work on OSX (provided gnu-sed in installed)
  4. if type gsed
  5. then
  6. alias sed=gsed
  7. fi
  8. version=$(jq --raw-output ' .version ' "package.json")
  9. date=$(date +%Y-%m-%d)
  10. sed \
  11. --regexp-extended \
  12. --in-place="" \
  13. "s$^## \[Unreleased\]$\## [Unreleased\]\n\n\n## [${version}] - ${date}$" \
  14. CHANGELOG.md
  15. git add CHANGELOG.md