diff --git a/src/aggregate.py b/src/aggregate.py index 8bb5e08..4107fbb 100644 --- a/src/aggregate.py +++ b/src/aggregate.py @@ -194,7 +194,8 @@ def _build_files_section_from_items(file_items: list[dict[str, Any]]) -> str: if path is None: sections.append(f"### `{entry}`\n\n```text\n{content}\n```") else: - suffix = path.suffix.lstrip(".") if path.suffix else "text" + path_obj = Path(path) if isinstance(path, str) else path + suffix = path_obj.suffix.lstrip(".") if path_obj.suffix else "text" original = entry if "*" not in entry else str(path) sections.append(f"### `{original}`\n\n```{suffix}\n{content}\n```") return "\n\n---\n\n".join(sections)