upload root dir
This commit is contained in:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user