MCPcopy
hub / github.com/anthropics/financial-services / cmd_apply

Function cmd_apply

scripts/version_bump.py:148–164  ·  view source on GitHub ↗
(base: str)

Source from the content-addressed store, hash-verified

146
147
148def cmd_apply(base: str) -> int:
149 bumped = []
150 for pj in changed_plugins(base, staged_only=True):
151 work = working_version(pj)
152 bv = base_version(base, pj)
153 if is_ahead(work, bv):
154 continue # already bumped on this branch — idempotent no-op
155 new = patch_bump(bv or work or "0.0.0")
156 data = json.loads(pj.read_text())
157 data["version"] = new
158 pj.write_text(json.dumps(data, indent=2) + "\n")
159 git("add", rel(pj))
160 bumped.append((rel(plugin_root(pj)), bv, new))
161
162 for name, old, new in bumped:
163 print(f"[version-bump] {name}: {old or '(new)'} -> {new}")
164 return 0
165
166
167def cmd_check(base: str) -> int:

Callers 1

mainFunction · 0.85

Calls 8

changed_pluginsFunction · 0.85
working_versionFunction · 0.85
base_versionFunction · 0.85
is_aheadFunction · 0.85
patch_bumpFunction · 0.85
gitFunction · 0.85
plugin_rootFunction · 0.85
relFunction · 0.70

Tested by

no test coverage detected