def _get_s3_subpaths()

in migration/bring-your-own-gdc-assets/bring_your_own_gdc_assets.py [0:0]


def _get_s3_subpaths(s3_path):
    """
    Get all sub-paths for a given S3 path.
    Returns list of paths from bucket to full path.
    """

    # Remove trailing slash if present
    s3_path = s3_path.rstrip('/')

    paths = []
    # Split into parts
    parts = s3_path.split('/')
    current = parts[0] + '//' + parts[2]  # s3://bucket
    paths.append(current)

    # Add each subfolder level
    for part in parts[3:]:
        current = current + '/' + part
        paths.append(current)

    return paths