INNER CODE UNIT · Python

update_changelog

jpush/jpush-react-native · .claude/skills/update-sdk/scripts/plugin_updater.py:201

def update_changelog(changelog_file: str, plugin_version: str, summary: str):
    path = Path(changelog_file)
    date_str = datetime.now().strftime("%Y-%m-%d")
    entry = f"## {plugin_version} ({date_str})\n\n{summary}\n\n"
    existing = path.read_text(encoding="utf-8") if path.exists() else "# Changelog\n\n"
    path.write_text(entry + existing, encoding="utf-8")
    print(f"  UPDATED: {changelog_file} → added v{plugin_version} entry")


def process_file_ref(ref: dict, version: str) -> bool:
    path = ref["path"]
    if "pattern" in ref:
        return update_by_pattern(path, ref["pattern"], version)
    elif "key" in ref:
        if path.endswith(".yaml") or path.endswith(".yml"):
            return update_yaml_version(path, version)
        elif path.endswith(".xml"):
            return update_xml_attribute(path, ref["key"], version)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…