Skip to main content

include empty objects which aren’t directories

ID
2890f1b
date
2023-06-21 23:45:00+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
53e8065
message
include empty objects which aren't directories
changed files
1 file, 1 addition, 1 deletion

Changed files

aws/s3tree.py (6203) → aws/s3tree.py (6238)

diff --git a/aws/s3tree.py b/aws/s3tree.py
index 6be1138..89231e5 100755
--- a/aws/s3tree.py
+++ b/aws/s3tree.py
@@ -183,7 +183,7 @@ if __name__ == "__main__":
         print("(no objects)")
         sys.exit(1)
 
-    keys = [s3_obj["Key"] for s3_obj in s3_objects if s3_obj["Size"] > 0]
+    keys = [s3_obj["Key"] for s3_obj in s3_objects if s3_obj["Size"] > 0 or not s3_obj["Key"].endswith("/")]
 
     tree = build_s3_tree(keys)