From a8ce9d11804afcfc856e18f408e8eadd514f0c08 Mon Sep 17 00:00:00 2001 From: Stefan Hausotte Date: Mon, 15 Jun 2026 19:06:16 +0200 Subject: [PATCH] ci: make release recipe sed portable across BSD and GNU sed (#83) `just release` used `sed -i ''`, which is BSD/macOS syntax. In the nix dev shell GNU sed shadows it and reads `''` as an empty script and the s/.../ expression as a filename, aborting the version bump. Use `-i.bak` plus a cleanup `rm`, which works on both BSD and GNU sed. Reviewed-on: https://codeberg.org/secana/Forji/pulls/83 --- justfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index b45d23c..d39ea39 100644 --- a/justfile +++ b/justfile @@ -65,9 +65,11 @@ release new_version: PREV=$(grep -m1 'MARKETING_VERSION' {{pbxproj}} | sed 's/.*= *//;s/;.*//') echo "Releasing $PREV -> $NEW" - # 1. Bump the version in the Xcode project. - sed -i '' "s/MARKETING_VERSION = [^;]*/MARKETING_VERSION = $NEW/" {{pbxproj}} - sed -i '' "s/CURRENT_PROJECT_VERSION = [^;]*/CURRENT_PROJECT_VERSION = $NEW/" {{pbxproj}} + # 1. Bump the version in the Xcode project. Use a backup suffix so the -i + # syntax works on both BSD sed (macOS) and GNU sed (nix dev shell). + sed -i.bak "s/MARKETING_VERSION = [^;]*/MARKETING_VERSION = $NEW/" {{pbxproj}} + sed -i.bak "s/CURRENT_PROJECT_VERSION = [^;]*/CURRENT_PROJECT_VERSION = $NEW/" {{pbxproj}} + rm -f {{pbxproj}}.bak # 2. Generate the changelog section for the new version from the conventional # commits since the last tag, prepending it under the header.