create cache directory, if not exists

This commit is contained in:
Christoph Stahl 2024-09-30 14:39:13 +02:00
parent fb05b44b71
commit 46f68e2e92

View file

@ -94,6 +94,8 @@ class S3Source(FileBasedSource):
if obj.object_name is not None and self.has_correct_extension(obj.object_name)
]
if self.index_file is not None and not os.path.isfile(self.index_file):
os.makedirs(os.path.dirname(self.index_file), exist_ok=True)
with open(self.index_file, "w", encoding="utf8") as index_file_handle:
dump(file_list, index_file_handle)
return file_list