Skip to content

Commit

Permalink
Support sources pointing to local folder
Browse files Browse the repository at this point in the history
  • Loading branch information
geoo89 committed Jul 31, 2024
1 parent 5c8922d commit 48e9d68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/parenttext_pipeline/compile_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ def compile_sources(repo_folder, destination_folder):
for parent_id, parent in config.parents.items():
parent_destination_folder = destination_folder / parent_id
with tempfile.TemporaryDirectory() as temp_dir:
unpack_archive(temp_dir, parent.location)
if parent.location.endswith(".zip"):
unpack_archive(temp_dir, parent.location)
else:
shutil.copytree(parent.location, Path(temp_dir) / "archive")
# after extracting, all the stuff is inside a subfolder
# which we need to identify.
folder_contents = os.listdir(temp_dir)
Expand Down

0 comments on commit 48e9d68

Please sign in to comment.