aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/fs/lua.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua
index ea16b728..9806bb63 100644
--- a/src/luarocks/fs/lua.lua
+++ b/src/luarocks/fs/lua.lua
@@ -498,6 +498,14 @@ function fs_lua.unzip(zipfile)
498 local ok, err = fs.make_dir(dir.path(fs.current_dir(), file.filename)) 498 local ok, err = fs.make_dir(dir.path(fs.current_dir(), file.filename))
499 if not ok then return nil, err end 499 if not ok then return nil, err end
500 else 500 else
501 local base = dir.dir_name(file.filename)
502 if base ~= "" then
503 base = dir.path(fs.current_dir(), base)
504 if not fs.is_dir(base) then
505 local ok, err = fs.make_dir(base)
506 if not ok then return nil, err end
507 end
508 end
501 local rf, err = zipfile:open(file.filename) 509 local rf, err = zipfile:open(file.filename)
502 if not rf then zipfile:close(); return nil, err end 510 if not rf then zipfile:close(); return nil, err end
503 local contents = rf:read("*a") 511 local contents = rf:read("*a")