Commit a chunk's changes to the config's folder in its own repo
CI / tests (pull_request) Failing after 2m33s
CI / tests (pull_request) Failing after 2m33s
This commit is contained in:
@@ -64,6 +64,15 @@ def load(top: pathlib.Path, main: pathlib.Path, home: pathlib.Path) -> ProjectCo
|
||||
return ProjectConfig(file.parent.name, file.parent, top, {name: path for name, path in paths.items() if path})
|
||||
|
||||
|
||||
def held(folder: pathlib.Path, home: pathlib.Path) -> ProjectConfig | Failure | None:
|
||||
"""The config folder holds, as its project's main checkout reads it; None where folder is not a config's folder under home."""
|
||||
file = folder / CONFIG
|
||||
if folder.resolve().parent != (home / PROJECTS).resolve() or not file.is_file():
|
||||
return None
|
||||
config = read(file, home)
|
||||
return config if isinstance(config, Failure) else load(config[0], config[0], home)
|
||||
|
||||
|
||||
def read(file: pathlib.Path, home: pathlib.Path) -> tuple[pathlib.Path, dict[str, object]] | Failure:
|
||||
"""The checkout a config names, as an absolute path, and its other values."""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user