ssh.write_remote_file : quoter $(dirname) (chemins avec espace, ex. Application Support/ngrok)
1 changed file +2 −1
modified
mld/ssh.py
+2 −1
@@ -74,5 +74,6 @@ def scp_to(ip, local_file, remote_path): | ||
| 74 | 74 | def write_remote_file(ip, remote_path, content, mode="644"): |
| 75 | 75 | """Écrit un fichier sur le nœud via heredoc (contenu texte).""" |
| 76 | 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 | 79 | return run(ip, script, timeout=60) |
| 79 | 80 | |