Skip to content

Commit

Permalink
[AWS S3] Upload_dir subdir fix (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
laemtl authored Oct 16, 2023
1 parent af6591f commit 69ff4c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions python/extract_eeg_bids_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def main():
"""
If the suject/session/modality BIDS data already exists
on the destination folder, delete it first
copying the data
before copying the data
"""
s3_obj.delete_file(s3_data_eeg_modality_path)

Expand All @@ -222,7 +222,6 @@ def main():
copying the data
"""
imaging_io_obj.remove_dir(data_eeg_modality_path)

imaging_io_obj.copy_file(tmp_eeg_modality_path, data_eeg_modality_path)

# Delete tmp location
Expand Down
2 changes: 1 addition & 1 deletion python/lib/aws_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def upload_dir(self, dir_name, s3_object_name, force = False):

for (root, dirs, files) in os.walk(dir_name):
for file in files:
s3_prefix = os.path.join(s3_file_name, root.replace(dir_name, ""), file)
s3_prefix = os.path.join(s3_file_name, root.replace(dir_name, "").lstrip('/'), file)
s3_dest = os.path.join(
's3://',
s3_bucket_name,
Expand Down

0 comments on commit 69ff4c6

Please sign in to comment.