Expand intel coverage and refresh monitoring
这个提交包含在:
@@ -85,15 +85,20 @@ def read_json(path: Path, default: Any = None) -> Any:
|
||||
|
||||
def write_json(path: Path, data: Any) -> None:
|
||||
ensure_dir(path.parent)
|
||||
content = json.dumps(data, indent=2, ensure_ascii=True, sort_keys=False) + "\n"
|
||||
if path.exists() and path.read_text(encoding="utf-8") == content:
|
||||
return
|
||||
with path.open("w", encoding="utf-8") as handle:
|
||||
json.dump(data, handle, indent=2, ensure_ascii=True, sort_keys=False)
|
||||
handle.write("\n")
|
||||
handle.write(content)
|
||||
|
||||
|
||||
def write_text(path: Path, content: str) -> None:
|
||||
ensure_dir(path.parent)
|
||||
rendered = content.rstrip() + "\n"
|
||||
if path.exists() and path.read_text(encoding="utf-8") == rendered:
|
||||
return
|
||||
with path.open("w", encoding="utf-8") as handle:
|
||||
handle.write(content.rstrip() + "\n")
|
||||
handle.write(rendered)
|
||||
|
||||
|
||||
def run(cmd: List[str], cwd: Optional[Path] = None, check: bool = True) -> subprocess.CompletedProcess:
|
||||
|
||||
在新工单中引用
屏蔽一个用户