From f62e6cf6e34638189e1cf40541b11905b0d14255 Mon Sep 17 00:00:00 2001 From: Jealous Date: Mon, 16 Feb 2026 22:46:06 +0800 Subject: [PATCH] fix(build): add macOS compatibility for sed command (#378) * fix(build): add macOS compatibility for sed command Handle platform-specific sed syntax for both macOS and Linux when updating package.json version. Co-Authored-By: Claude Sonnet 4.5 * Update sed syntax comment for cross-platform compatibility Signed-off-by: MadDogOwner --------- Signed-off-by: MadDogOwner Co-authored-by: Claude Sonnet 4.5 Co-authored-by: MadDogOwner --- build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 191c812..a77ecc9 100755 --- a/build.sh +++ b/build.sh @@ -123,7 +123,12 @@ fallback_git_tag() { # Update package.json version update_package_version() { if [[ "$BUILD_TYPE" == "dev" ]]; then - sed -i "s/\"version\": *\"[^\"]*\"/\"version\": \"${git_version_clean}\"/" package.json + # Handle both BSD and GNU sed syntax + if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i "" "s/\"version\": *\"[^\"]*\"/\"version\": \"${git_version_clean}\"/" package.json + else + sed -i "s/\"version\": *\"[^\"]*\"/\"version\": \"${git_version_clean}\"/" package.json + fi log_success "Package.json version updated to ${git_version_clean}" version_tag="v${git_version_clean}-${commit}" log_build "Building DEV version ${version_tag}..."