2024-02-26 18:59:58 +01:00
|
|
|
from pathlib import Path
|
|
|
|
|
2024-02-21 20:46:59 +01:00
|
|
|
from . import data
|
2024-02-26 18:59:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
def write_tree(directory="."):
|
|
|
|
with Path.iterdir(directory) as it:
|
|
|
|
for entry in it:
|
|
|
|
full = f"{directory}/{entry.name}"
|
2024-02-28 19:45:34 +01:00
|
|
|
if is_ignored(full):
|
|
|
|
continue
|
2024-02-26 18:59:58 +01:00
|
|
|
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)
|
2024-02-28 19:45:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
def is_ignored(path):
|
|
|
|
return ".ugit" in path.split("/")
|