Skip to content

Commit 341f1bd

Browse files
committed
Solution to directory bug
1 parent 3b0f64d commit 341f1bd

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

__main__.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,11 @@ def push():
6666
remote_path = repo_config["path"]
6767

6868
def ensure_remote_directory(remote_dir):
69-
# Always ensure the remote directory path ends with a slash
70-
if not remote_dir.endswith('/'):
71-
remote_dir += '/'
72-
parts = remote_dir.split('/')
73-
current = ""
74-
for part in parts:
75-
if part: # skip empty parts from leading '/'
76-
current += "/" + part
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):
80-
try:
81-
client.mkdir(current_slash)
82-
except Exception as e:
83-
click.echo(click.style(f"Error creating directory {current_slash}: {e}", fg="red"))
69+
try:
70+
client.mkdir(remote_dir)
71+
except Exception as e:
72+
pass
73+
8474

8575
for root, _, files in os.walk(copy_dir):
8676
for file in files:

0 commit comments

Comments
 (0)