-
Notifications
You must be signed in to change notification settings - Fork 11
Description
tw data-links download works when the requested “folder” contains only files, but fails when the folder contains any subfolder. The CLI appears to treat directory entries (paths ending in /, size: null) as files and calls generate-download-url on them, which returns 404 (“File … not found”).
This works if you target a leaf folder that contains only files (no subfolders). This fails as soon as the parent folder includes a nested directory entry.
To reproduce:
Use a folder with 1 file + 1 subfolder:
tw data-links download ... <folder>/will fail the moment it reaches the subfolder entry.tw data-links download ... <folder>/<subfolder>/will work.
CLI lists contents using browse-tree, downloads the first file, then fails when it hits a directory entry:
- path ends in
/ "size": null(e.g. .../index_reports/, .../logs/, .../results/)- CLI generates a download URL for a file
- CLI calls
generate-download-urlon a directory path (.../index_reports/)
Expected Behaviour
The CLI should recurse into directories and call generate-download-url for files or provide a --recursive flag like the AWS CLI to make recursion optional but not hard fail if folder entries exist.