SPB Git

ssh.write_remote_file : quoter $(dirname) (chemins avec espace, ex. Application Support/ngrok)

Simon-Pierre Boucher committed (Sep 8, 2026) parent 5c5e960 Browse files

1 changed file +2 −1

Unified Split
modified mld/ssh.py +2 −1
@@ -74,5 +74,6 @@ def scp_to(ip, local_file, remote_path):
74 def write_remote_file(ip, remote_path, content, mode="644"): 74 def write_remote_file(ip, remote_path, content, mode="644"):
75 """Écrit un fichier sur le nœud via heredoc (contenu texte).""" 75 """Écrit un fichier sur le nœud via heredoc (contenu texte)."""
76 q = shlex.quote(remote_path) 76 q = shlex.quote(remote_path)
77− script = "mkdir -p $(dirname %s) && cat > %s <<'__MLD_EOF__'\n%s\n__MLD_EOF__\nchmod %s %s" % (q, q, content, mode, q) 77+ # "$(dirname …)" entre guillemets : sinon un chemin avec espace (Library/Application Support) est éclaté en deux mkdir
78+ script = "mkdir -p \"$(dirname %s)\" && cat > %s <<'__MLD_EOF__'\n%s\n__MLD_EOF__\nchmod %s %s" % (q, q, content, mode, q)
78 return run(ip, script, timeout=60) 79 return run(ip, script, timeout=60)
79 80
Menu

Theme