From e6d2732fc28993aac828a2d8c48c3a2a3cf8075d Mon Sep 17 00:00:00 2001 From: Sam Perman Date: Thu, 10 Sep 2026 09:59:44 -0400 Subject: [PATCH] docs: make release changelog commands portable to macOS The two sed -i calls in the release and re-arm steps only work with GNU sed. BSD sed on macOS requires a suffix argument after -i, and the re-arm command also uses the GNU-only 0,/re/ address and \n in the replacement. Replace both with perl, which is preinstalled on macOS and Linux and behaves the same on both. --- CONTRIBUTING.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 907ab581..ea8697e4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -97,7 +97,8 @@ before _EACH_ release, even beta releases. VERSION="$(uv version --bump stable --dry-run --short)" # use "--bump minor" if there are new features git checkout -b "release-$VERSION" main uv version "$VERSION" -sed -i "s/^## Unreleased/## [$VERSION] - $(date +%Y-%m-%d)/" docs/CHANGELOG.md +# perl, not sed: GNU sed (Linux) and BSD sed (macOS) take different -i arguments +perl -pi -e "s/^## Unreleased/## [$VERSION] - $(date +%Y-%m-%d)/" docs/CHANGELOG.md git commit -am "Release $VERSION" git push -u origin "release-$VERSION" gh pr create --title "Release $VERSION" --body "Release $VERSION" @@ -129,7 +130,7 @@ version ```bash VERSION="$(uv version --bump patch --bump dev --dry-run --short)" # e.g. 1.29.1 -> 1.29.2.dev1 git checkout -b "rearm-$VERSION" main -sed -i '0,/^## \[/s//## Unreleased\n\n&/' docs/CHANGELOG.md +perl -0777 -pi -e 's/^## \[/## Unreleased\n\n$&/m' docs/CHANGELOG.md uv version "$VERSION" git commit -am "Begin $VERSION development" git push -u origin "rearm-$VERSION"