diff options
-rw-r--r-- | src/luarocks/repos.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/luarocks/repos.lua b/src/luarocks/repos.lua index eaec87b8..0058d928 100644 --- a/src/luarocks/repos.lua +++ b/src/luarocks/repos.lua | |||
@@ -262,6 +262,7 @@ end | |||
262 | 262 | ||
263 | local function backup_existing(should_backup, target) | 263 | local function backup_existing(should_backup, target) |
264 | if not should_backup then | 264 | if not should_backup then |
265 | fs.delete(target) | ||
265 | return | 266 | return |
266 | end | 267 | end |
267 | if fs.exists(target) then | 268 | if fs.exists(target) then |
@@ -301,6 +302,7 @@ local function op_rename(op) | |||
301 | 302 | ||
302 | if fs.exists(op.src) then | 303 | if fs.exists(op.src) then |
303 | fs.make_dir(dir.dir_name(op.dst)) | 304 | fs.make_dir(dir.dir_name(op.dst)) |
305 | fs.delete(op.dst) | ||
304 | local ok, err = fs.move(op.src, op.dst) | 306 | local ok, err = fs.move(op.src, op.dst) |
305 | fs.remove_dir_tree_if_empty(dir.dir_name(op.src)) | 307 | fs.remove_dir_tree_if_empty(dir.dir_name(op.src)) |
306 | return ok, err | 308 | return ok, err |