Skip to content

Commit ff73c4a

Browse files
Fix sync --pull for root folder
Fixes #26
1 parent 58c186e commit ff73c4a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cloudinary_cli/utils/api_utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414

1515
def query_cld_folder(folder):
1616
files = {}
17-
next_cursor = True
1817

19-
folder = folder.rstrip('/')
18+
folder = folder.strip('/') # omit redundant leading slash and duplicate trailing slashes in query
19+
folder_query = f"{folder}/*" if folder else "*"
20+
21+
expression = Search().expression(f"folder:\"{folder_query}\"").with_field("image_analysis").max_results(500)
2022

21-
expression = Search().expression(f"folder:\"{folder}/*\"").with_field("image_analysis").max_results(500)
23+
next_cursor = True
2224
while next_cursor:
2325
res = expression.execute()
2426

0 commit comments

Comments
 (0)