INNER CODE UNIT · Python

get_plugin_version

jpush/jpush-react-native · .claude/skills/update-sdk/scripts/publisher.py:29

def get_plugin_version(config: dict) -> str:
    refs = config.get("version_refs", {})
    for ref in refs.get("plugin", {}).get("files", []):
        path = Path(ref["path"])
        if not path.exists():
            continue
        if path.suffix == ".json":
            data = json.loads(path.read_text(encoding="utf-8"))
            key = ref.get("key", "version")
            for k in key.split("."):
                data = data.get(k, {})
            if isinstance(data, str):
                return data
        elif path.suffix in (".yaml", ".yml"):
            m = re.search(r"^version:\s*(.+)$", path.read_text(encoding="utf-8"), re.MULTILINE)
            if m:
                return m.group(1).strip()
        elif path.suffix == ".xml":

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…