From 4099794c7487947b0656a3aaa2a65a51b0eddcda Mon Sep 17 00:00:00 2001 From: Affaan Mustafa Date: Mon, 27 Jul 2026 14:05:18 -0400 Subject: [PATCH] fix(release): bump the claude marketplace and zh-CN heading on macOS Two bumps were being skipped, both caught by plugin-manifest.test.js only after the version had already been rewritten across twenty files. .claude-plugin/marketplace.json used sed with GNU's 0,/re/ address form. BSD sed on macOS ignores it and exits 0, so the substitution silently did nothing. Replaced with a node first-match rewrite that fails loudly. docs/zh-CN/README.md had its version row updated but not its release heading, unlike the other localized READMEs. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_0149VwNuynam6rvEfcMmiHHa --- scripts/release.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/scripts/release.sh b/scripts/release.sh index a71d49218..871496f21 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -140,6 +140,29 @@ update_readme_version_row() { ' "$file" "$VERSION" "$label" "$first_col" "$second_col" "$third_col" } +update_marketplace_plugin_version() { + local file="$1" + # Was `sed "0,/re/s|..."`, which is a GNU extension. BSD sed on macOS ignores + # it and still exits 0, so the bump silently no-opped here and only surfaced + # later as a plugin-manifest test failure. Node replaces the first match on + # every platform and fails loudly. + node -e ' + const fs = require("fs"); + const file = process.argv[1]; + const version = process.argv[2]; + const current = fs.readFileSync(file, "utf8"); + const updated = current.replace( + /"version": *"[0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z.-]+)?"/, + `"version": "${version}"` + ); + if (updated === current) { + console.error(`Error: could not update plugin version in ${file}`); + process.exit(1); + } + fs.writeFileSync(file, updated); + ' "$file" "$VERSION" +} + update_latest_release_heading() { local file="$1" node -e ' @@ -268,7 +291,7 @@ update_agents_version "$ZH_CN_AGENTS_MD" "版本" update_agent_yaml_version update_version_file update_version "$PLUGIN_JSON" "s|\"version\": *\"[^\"]*\"|\"version\": \"$VERSION\"|" -update_version "$MARKETPLACE_JSON" "0,/\"version\": *\"[^\"]*\"/s|\"version\": *\"[^\"]*\"|\"version\": \"$VERSION\"|" +update_marketplace_plugin_version "$MARKETPLACE_JSON" update_codex_marketplace_version update_version "$CODEX_PLUGIN_JSON" "s|\"version\": *\"[^\"]*\"|\"version\": \"$VERSION\"|" update_version "$CODEX_MARKETPLACE_PLUGIN_JSON" "s|\"version\": *\"[^\"]*\"|\"version\": \"$VERSION\"|" @@ -281,6 +304,9 @@ update_latest_release_heading "$README_FILE" update_latest_release_heading "$ROOT_ZH_CN_README_FILE" update_latest_release_heading "$TR_README_FILE" update_latest_release_heading "$PT_BR_README_FILE" +# docs/zh-CN/README.md got its version row bumped but never its release +# heading, so plugin-manifest.test.js failed on it every time. +update_latest_release_heading "$ZH_CN_README_FILE" update_selective_install_repo_version "$SELECTIVE_INSTALL_ARCHITECTURE_DOC" # Verify the bumped release surface is still internally consistent before