From c9f4d70c56bae26a5aad03366de162eb4bbb4517 Mon Sep 17 00:00:00 2001 From: cdricms <36056008+cdricms@users.noreply.github.com> Date: Thu, 13 Mar 2025 00:28:03 +0100 Subject: [PATCH] upload root dir --- lua/nvim-sync-ftp/cli.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/nvim-sync-ftp/cli.lua b/lua/nvim-sync-ftp/cli.lua index 8cfc7cc..e6e3f43 100644 --- a/lua/nvim-sync-ftp/cli.lua +++ b/lua/nvim-sync-ftp/cli.lua @@ -134,14 +134,11 @@ function M.UploadFile() local remotePath = config.remote_path .. relative_path - print("remotePath:", remotePath) - print("current_buffer_path:", current_buffer_path) local dir = dirname(remotePath) local command = string.format( "lftp -u '%s,%s' ftp://%s -e 'set ssl:verify-certificate no;mkdir -p %s; cd %s;put %s; quit' > /dev/null 2>&1", config.user, config.password, config.host, dir, dir, current_buffer_path ) - print("Generated command:", command) vim.uv.spawn("sh", { args = { "-c", command }, @@ -179,11 +176,14 @@ function M.UploadDir() local remote = path_components(remotePath) local localDir = dirname(current_buffer_path) + if localDir == directoryTemp then + localDir = "." + remote.parent = config.remote_path + end local command = string.format( - "lftp -u '%s,%s' ftp://%s -e 'set ssl:verify-certificate no;mkdir -p %q;cd %q;mirror -R %q; quit'", + "lftp -u '%s,%s' ftp://%s -e 'set ssl:verify-certificate no;mkdir -p %q;cd %q;mirror -R %q; quit' >/dev/null 2>&1", config.user, config.password, config.host, remote.parent, remote.parent, localDir ) - print("Generated command:", command) vim.uv.spawn("sh", { args = { "-c", command },