From deb520e26b261c70c1a0d57cd41804b11ddc77c7 Mon Sep 17 00:00:00 2001 From: yhirose Date: Sat, 19 Sep 2026 13:56:31 -0400 Subject: [PATCH] Update version files with sed -i.bak, which GNU sed accepts too `sed -i ''` is BSD-only: GNU sed takes the '' as the script and the expression as a file name, so `just release --run` failed on Linux before touching anything. --- scripts/release.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index f58b6f4c..9d953791 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -164,14 +164,18 @@ if [ "$DRY_RUN" -eq 1 ]; then echo "==> Dry run complete. No changes were made." else echo "==> Updating httplib.h..." - sed -i '' "s/#define CPPHTTPLIB_VERSION \"[^\"]*\"/#define CPPHTTPLIB_VERSION \"$NEW_VERSION\"/" httplib.h - sed -i '' "s/#define CPPHTTPLIB_VERSION_NUM \"0x[0-9a-fA-F]*\"/#define CPPHTTPLIB_VERSION_NUM \"$VERSION_HEX\"/" httplib.h + # `-i.bak` is the in-place form GNU and BSD sed both accept (`-i ''` is + # BSD-only: GNU sed reads the '' as the script). + sed -i.bak "s/#define CPPHTTPLIB_VERSION \"[^\"]*\"/#define CPPHTTPLIB_VERSION \"$NEW_VERSION\"/" httplib.h + sed -i.bak "s/#define CPPHTTPLIB_VERSION_NUM \"0x[0-9a-fA-F]*\"/#define CPPHTTPLIB_VERSION_NUM \"$VERSION_HEX\"/" httplib.h + rm -f httplib.h.bak echo " CPPHTTPLIB_VERSION = \"$NEW_VERSION\"" echo " CPPHTTPLIB_VERSION_NUM = \"$VERSION_HEX\"" echo "" echo "==> Updating docs-src/config.toml..." - sed -i '' "s/^version = \"[^\"]*\"/version = \"$NEW_VERSION\"/" docs-src/config.toml + sed -i.bak "s/^version = \"[^\"]*\"/version = \"$NEW_VERSION\"/" docs-src/config.toml + rm -f docs-src/config.toml.bak echo " version = \"$NEW_VERSION\"" # --- Step 6: Commit, tag, and push ---