MCPcopy Index your code
hub / github.com/masterking32/MasterHttpRelayVPN / write_config

Function write_config

setup.py:152–159  ·  view source on GitHub ↗
(cfg: dict)

Source from the content-addressed store, hash-verified

150
151
152def write_config(cfg: dict) -> None:
153 if CONFIG_PATH.exists():
154 backup = CONFIG_PATH.with_suffix(".json.bak")
155 shutil.copy2(CONFIG_PATH, backup)
156 print(yellow(f" existing config.json backed up to {backup.name}"))
157 with CONFIG_PATH.open("w", encoding="utf-8") as f:
158 json.dump(cfg, f, indent=2)
159 f.write("\n")
160
161
162def main() -> int:

Callers 1

mainFunction · 0.85

Calls 1

yellowFunction · 0.85

Tested by

no test coverage detected