complete_on_downloads for task block (#403)

This commit is contained in:
Kerem Yilmaz 2024-06-02 23:24:30 -07:00 committed by GitHub
parent 343937e12c
commit f1d5a3a687
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 118 additions and 30 deletions

View file

@ -68,3 +68,13 @@ def zip_files(files_path: str, zip_file_path: str) -> str:
def get_path_for_workflow_download_directory(workflow_run_id: str) -> Path:
return Path(f"{REPO_ROOT_DIR}/downloads/{workflow_run_id}/")
def get_number_of_files_in_directory(directory: Path, recursive: bool = False) -> int:
count = 0
for root, dirs, files in os.walk(directory):
if not recursive:
count += len(files)
break
count += len(files)
return count