github-pages-deploy-action/node_modules/damerau-levenshtein/scripts/update-changelog.sh

22 lines
372 B
Bash
Raw Normal View History

2020-03-07 11:45:40 +08:00
#! /usr/bin/env bash
set -euo pipefail
# To make it work on OSX (provided gnu-sed in installed)
if type gsed
then
sed=gsed
fi
version=$(jq --raw-output ' .version ' "package.json")
date=$(date +%Y-%m-%d)
$sed \
--regexp-extended \
--in-place="" \
"s$^## \[Unreleased\]$\## [Unreleased\]\n\n\n## [${version}] - ${date}$" \
CHANGELOG.md
git add CHANGELOG.md