File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -66,18 +66,21 @@ def push():
6666 remote_path = repo_config ["path" ]
6767
6868 def ensure_remote_directory (remote_dir ):
69- # Remove trailing slash (if any) and split the path
70- remote_dir = remote_dir .rstrip ('/' )
69+ # Always ensure the remote directory path ends with a slash
70+ if not remote_dir .endswith ('/' ):
71+ remote_dir += '/'
7172 parts = remote_dir .split ('/' )
7273 current = ""
7374 for part in parts :
74- if part : # skip empty parts from leading /
75+ if part : # skip empty parts from leading '/'
7576 current += "/" + part
76- if not client .is_dir (current ):
77+ # Always check with trailing slash so that it is recognized as a directory.
78+ current_slash = current + "/"
79+ if not client .is_dir (current_slash ):
7780 try :
78- client .mkdir (current )
81+ client .mkdir (current_slash )
7982 except Exception as e :
80- click .echo (click .style (f"Error creating directory { current } : { e } " , fg = "red" ))
83+ click .echo (click .style (f"Error creating directory { current_slash } : { e } " , fg = "red" ))
8184
8285 for root , _ , files in os .walk (copy_dir ):
8386 for file in files :
You can’t perform that action at this time.
0 commit comments