INNER CODE UNIT · Python
load_config
jpush/jpush-react-native · .claude/skills/update-sdk/scripts/publisher.py:14
def load_config():
with open(CONFIG_PATH, "r", encoding="utf-8") as f:
return json.load(f)
def run(cmd: list, cwd: str = ".") -> tuple:
try:
r = subprocess.run(cmd, cwd=cwd, capture_output=True, text=True, timeout=300)
return r.returncode == 0, (r.stdout + r.stderr).strip()
except subprocess.TimeoutExpired:
return False, "Command timed out after 300 seconds"
except Exception as e:
return False, str(e)
def get_plugin_version(config: dict) -> str:
refs = config.get("version_refs", {})
for ref in refs.get("plugin", {}).get("files", []):