aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/luarocks/fs/lua.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua
index ea16b728..1a7b6be6 100644
--- a/src/luarocks/fs/lua.lua
+++ b/src/luarocks/fs/lua.lua
@@ -498,6 +498,11 @@ 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 ~= "" and not fs.is_dir(base) then
503 local ok, err = fs.make_dir(dir.path(fs.current_dir(), base))
504 if not ok then return nil, err end
505 end
501 local rf, err = zipfile:open(file.filename) 506 local rf, err = zipfile:open(file.filename)
502 if not rf then zipfile:close(); return nil, err end 507 if not rf then zipfile:close(); return nil, err end
503 local contents = rf:read("*a") 508 local contents = rf:read("*a")