"""Where the extracted disc is: `$SYLPHEED_DISC`, or a loud error. The censuses in this directory used to glob `/work/sylph_extract`, a path that stopped existing when `/work` became a clone of this repository. A glob over a missing directory matches nothing, so those scripts printed empty results instead of failing (see `name_block_bases.py`). Resolve the disc here so that cannot happen quietly again. """ import os import sys def disc_root(): """The extracted disc's root — the directory holding `dat/` and `hidden/`.""" root = os.environ.get("SYLPHEED_DISC") if not root or not os.path.isdir(os.path.join(root, "dat")): sys.exit( f"SYLPHEED_DISC={root!r} is not an extracted disc (no dat/ inside). " "Set it to the directory that holds dat/ and hidden/." ) return root