Skip to content

Commit

Permalink
tools: Tweak scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 27, 2024
1 parent fc2ee67 commit c7cf0c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,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
Expand Down
1 change: 1 addition & 0 deletions tools/tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ if [[ -n "$(git ls-files '*.rs')" ]]; then
error "please replace \`.cast()\` with \`.cast::<type_name>()\`:"
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 '^<!-- tidy:crate-doc:start -->' "${readme}"; then
Expand Down

0 comments on commit c7cf0c2

Please sign in to comment.