Skip to content

Commit 4a5e00e

Browse files
committed
Add support for wrapping package dependencies in wrap_content function
1 parent 362e3bc commit 4a5e00e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

codetide/core/common.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ def writeFile(contents :str, path :Union[str, Path], mode :str="w"):
1111
with open(path, mode, encoding=DEFAULT_ENCODING) as _file:
1212
_file.write(contents)
1313

14+
def wrap_package_dependencies(content: str) -> str:
15+
return f"""<PACKAGE_DEPENDENCIES_START>
16+
{content}
17+
</PACKAGE_DEPENDENCIES_END>"""
18+
1419
def wrap_content(content: str, filepath: str) -> str:
20+
if filepath == "PACKAGES":
21+
return wrap_package_dependencies(content)
22+
1523
return f"""<FILE_START::{filepath}>
1624
{content}
1725
</FILE_END::{filepath}>"""

0 commit comments

Comments
 (0)