Write-tree ignore .ugit files

This commit is contained in:
David Doblas Jiménez 2024-02-28 19:45:34 +01:00
parent fdfcfdbdad
commit 46a20c8b60
1 changed files with 6 additions and 0 deletions

View File

@ -7,8 +7,14 @@ def write_tree(directory="."):
with Path.iterdir(directory) as it:
for entry in it:
full = f"{directory}/{entry.name}"
if is_ignored(full):
continue
if entry.is_file(follow_symlinks=False):
# TODO write the file to object store
print(full)
elif entry.is_dir(follow_symlinks=False):
write_tree(full)
def is_ignored(path):
return ".ugit" in path.split("/")