mirror of
https://github.com/OpenListTeam/OpenList-Frontend.git
synced 2026-03-13 11:20:24 +00:00
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 <noreply@anthropic.com> * Update sed syntax comment for cross-platform compatibility Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> --------- Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: MadDogOwner <xiaoran@xrgzs.top>
This commit is contained in:
5
build.sh
5
build.sh
@@ -123,7 +123,12 @@ fallback_git_tag() {
|
||||
# Update package.json version
|
||||
update_package_version() {
|
||||
if [[ "$BUILD_TYPE" == "dev" ]]; then
|
||||
# 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}..."
|
||||
|
||||
Reference in New Issue
Block a user