| 553 | |
| 554 | |
| 555 | def init(path: Union[str, os.PathLike[str]]) -> str: |
| 556 | dvcignore = os.path.join(path, DvcIgnore.DVCIGNORE_FILE) |
| 557 | if os.path.exists(dvcignore): |
| 558 | return dvcignore |
| 559 | |
| 560 | with open(dvcignore, "w", encoding="utf-8") as fobj: |
| 561 | fobj.write( |
| 562 | "# Add patterns of files dvc should ignore, which could improve\n" |
| 563 | "# the performance. Learn more at\n" |
| 564 | "# https://dvc.org/doc/user-guide/dvcignore\n" |
| 565 | ) |
| 566 | |
| 567 | return dvcignore |
| 568 | |
| 569 | |
| 570 | def destroy(path: Union[str, os.PathLike[str]]) -> None: |