diff --git a/tools/publish.sh b/tools/publish.sh index d25c4f4c..7619b1d7 100755 --- a/tools/publish.sh +++ b/tools/publish.sh @@ -76,10 +76,10 @@ if [[ -n "${tags}" ]]; then fi # Update changelog. remote_url=$(grep -E '^\[Unreleased\]: https://' "${changelog}" | sed 's/^\[Unreleased\]: //; s/\.\.\.HEAD$//') - before_tag="${remote_url#*/compare/}" + prev_tag="${remote_url#*/compare/}" remote_url="${remote_url%/compare/*}" sed -i "s/^## \\[Unreleased\\]/## [Unreleased]\\n\\n## [${version}] - ${release_date}/" "${changelog}" - sed -i "s#^\[Unreleased\]: https://.*#[Unreleased]: ${remote_url}/compare/${tag}...HEAD\\n[${version}]: ${remote_url}/compare/${before_tag}...${tag}#" "${changelog}" + sed -i "s#^\[Unreleased\]: https://.*#[Unreleased]: ${remote_url}/compare/${tag}...HEAD\\n[${version}]: ${remote_url}/compare/${prev_tag}...${tag}#" "${changelog}" if ! grep -Eq "^## \\[${version//./\\.}\\] - ${release_date}$" "${changelog}"; then bail "failed to update ${changelog}" fi diff --git a/tools/tidy.sh b/tools/tidy.sh index ae213f6d..383cb3fd 100755 --- a/tools/tidy.sh +++ b/tools/tidy.sh @@ -91,6 +91,7 @@ if [[ -n "$(git ls-files '*.rs')" ]]; then error "please replace \`.cast()\` with \`.cast::()\`:" echo "${cast_without_turbofish}" fi + # Sync readme and crate-level doc. first='1' for readme in $(git ls-files '*README.md'); do if ! grep -q '^' "${readme}"; then