diff options
-rw-r--r-- | src/luarocks/fs/lua.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua index 1a7b6be6..9806bb63 100644 --- a/src/luarocks/fs/lua.lua +++ b/src/luarocks/fs/lua.lua | |||
@@ -499,9 +499,12 @@ function fs_lua.unzip(zipfile) | |||
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) | 501 | local base = dir.dir_name(file.filename) |
502 | if base ~= "" and not fs.is_dir(base) then | 502 | if base ~= "" then |
503 | local ok, err = fs.make_dir(dir.path(fs.current_dir(), base)) | 503 | base = dir.path(fs.current_dir(), base) |
504 | if not ok then return nil, err end | 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 | ||
505 | end | 508 | end |
506 | local rf, err = zipfile:open(file.filename) | 509 | local rf, err = zipfile:open(file.filename) |
507 | if not rf then zipfile:close(); return nil, err end | 510 | if not rf then zipfile:close(); return nil, err end |