INNER CODE UNIT · Python
_file_digest
faridrashidi/cnsplots · src/cnsplots/_cli.py:118
def _file_digest(destination: Path, name: str) -> str | None:
path = _checked_path(destination, name)
if not path.exists():
return None
if not path.is_file():
raise ValueError(f"expected a managed skill file: {path}")
return _digest(path.read_bytes())
def _read_manifest(destination: Path) -> _Manifest | None:
path = _checked_path(destination, _MANIFEST)
if not path.exists():
return None
try:
data = json.loads(path.read_text(encoding="utf-8"))
except ValueError as exc:
raise ValueError(f"invalid skill manifest: {path}") from exc
if (