diff options
-rw-r--r-- | src/luarocks/admin/cmd/remove.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/luarocks/admin/cmd/remove.lua b/src/luarocks/admin/cmd/remove.lua index 5d4c5fbb..ed7644e0 100644 --- a/src/luarocks/admin/cmd/remove.lua +++ b/src/luarocks/admin/cmd/remove.lua | |||
@@ -37,9 +37,6 @@ local function remove_files_from_server(refresh, rockfiles, server, upload_serve | |||
37 | if not local_cache then | 37 | if not local_cache then |
38 | return nil, protocol | 38 | return nil, protocol |
39 | end | 39 | end |
40 | if protocol ~= "rsync" then | ||
41 | return nil, "This command requires 'rsync', check your configuration." | ||
42 | end | ||
43 | 40 | ||
44 | local ok, err = fs.change_dir(at) | 41 | local ok, err = fs.change_dir(at) |
45 | if not ok then return nil, err end | 42 | if not ok then return nil, err end |
@@ -68,6 +65,17 @@ local function remove_files_from_server(refresh, rockfiles, server, upload_serve | |||
68 | util.printout("Updating index.html...") | 65 | util.printout("Updating index.html...") |
69 | index.make_index(local_cache) | 66 | index.make_index(local_cache) |
70 | 67 | ||
68 | if protocol == "file" then | ||
69 | local cmd = cfg.variables.RSYNC.." "..cfg.variables.RSYNCFLAGS.." --delete "..local_cache.."/ ".. server_path.."/" | ||
70 | util.printout(cmd) | ||
71 | fs.execute(cmd) | ||
72 | return true | ||
73 | end | ||
74 | |||
75 | if protocol ~= "rsync" then | ||
76 | return nil, "This command requires 'rsync', check your configuration." | ||
77 | end | ||
78 | |||
71 | local srv, path = server_path:match("([^/]+)(/.+)") | 79 | local srv, path = server_path:match("([^/]+)(/.+)") |
72 | local cmd = cfg.variables.RSYNC.." "..cfg.variables.RSYNCFLAGS.." --delete -e ssh "..local_cache.."/ "..user.."@"..srv..":"..path.."/" | 80 | local cmd = cfg.variables.RSYNC.." "..cfg.variables.RSYNCFLAGS.." --delete -e ssh "..local_cache.."/ "..user.."@"..srv..":"..path.."/" |
73 | 81 | ||