diff --git a/Makefile b/Makefile index ea9db7a..aa2e34a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ -.PHONY: site test deploy help +.PHONY: doctor-setup site test deploy help help: @grep -E "^[a-zA-Z_-]+:.*?## .*$$" $(MAKEFILE_LIST) | awk "BEGIN{FS=\":.*?## \"}{printf \" %-10s %s\\n\",\$$1,\$$2}" +doctor-setup: ## Bootstrap the environment for diagnostics + python3 scripts/check_doctor_setup.py site: ## Build docs _site/ python3 scripts/build_site.py _site test: ## Build the site and validate pages + internal links diff --git a/scripts/check_doctor_setup.py b/scripts/check_doctor_setup.py new file mode 100644 index 0000000..05c6cbc --- /dev/null +++ b/scripts/check_doctor_setup.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +"""Doctor workflow setup verification for docs repository.""" +from __future__ import annotations + +import sys +from pathlib import Path + + +def _ensure_files_exist(paths: list[str]) -> bool: + missing: list[str] = [path for path in paths if not Path(path).exists()] + if missing: + print(f"FAIL: missing required file(s): {', '.join(missing)}") + return False + return True + + +def main() -> int: + required = [ + "Makefile", + "scripts/build_site.py", + "scripts/check_site.py", + "scripts/check_node_types.py", + ] + if not _ensure_files_exist(required): + return 1 + print("Doctor setup checks passed") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main())