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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0149VwNuynam6rvEfcMmiHHa
This commit is contained in:
Affaan Mustafa
2026-07-27 14:05:18 -04:00
co-authored by Claude
parent 1ffaa75472
commit 4099794c74
+27 -1
View File
@@ -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