Skip to content

Commit 94e6be3

Browse files
Fix duplicate raw files extension in sync command
1 parent 4709fa0 commit 94e6be3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cloudinary_cli/utils/api_utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ def _display_path(asset):
8282
if asset.get("display_name") is None:
8383
return ""
8484

85-
return "/".join([asset.get("asset_folder", ""), ".".join(filter(None, [asset["display_name"], asset.get("format", None)]))])
85+
if asset["resource_type"] == "raw" or asset["type"] == 'fetch':
86+
normalized_display_name = asset["display_name"]
87+
else:
88+
normalized_display_name = ".".join(filter(None, [asset["display_name"], asset.get("format", None)]))
89+
90+
return "/".join([asset.get("asset_folder", ""), normalized_display_name])
8691

8792

8893
def _relative_display_path(asset, folder):
@@ -133,7 +138,7 @@ def upload_file(file_path, options, uploaded=None, failed=None):
133138
disp_path = _display_path(result)
134139
if "batch_id" in result:
135140
starting_msg = "Uploading"
136-
disp_str = f"asynchnously with batch_id: {result['batch_id']}"
141+
disp_str = f"asynchronously with batch_id: {result['batch_id']}"
137142
else:
138143
starting_msg = "Successfully uploaded"
139144
disp_str = f"as {result['public_id']}" if not disp_path \

0 commit comments

Comments
 (0)