mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-18 02:39:55 +00:00
20 lines
576 B
Python
20 lines
576 B
Python
"""Publish the canonical partition catalog without keeping a second source copy."""
|
|
|
|
from pathlib import Path
|
|
|
|
from mkdocs.structure.files import File
|
|
|
|
|
|
CATALOG_URI = "_data/esp32_partition_catalog.json"
|
|
|
|
|
|
def on_files(files, config):
|
|
source = (
|
|
Path(config.config_file_path).resolve().parent
|
|
/ "firmware" / "esp32_partition_catalog.json"
|
|
)
|
|
if not source.is_file():
|
|
raise FileNotFoundError(f"Canonical partition catalog is missing: {source}")
|
|
files.append(File.generated(config, CATALOG_URI, abs_src_path=str(source)))
|
|
return files
|