Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
Check if unzip failed
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Jan 10, 2014
1 parent a147020 commit 0402bce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/luarocks/manif.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,18 @@ function load_manifest(repo_url)
end
end
if pathname:match(".*%.zip$") then
pathname = fs.absolute_name(pathname)
local dir = dir.dir_name(pathname)
fs.change_dir(dir)
local nozip = pathname:match("(.*)%.zip$")
fs.delete(nozip)
fs.unzip(pathname)
local ok = fs.unzip(pathname)
fs.pop_dir()
if not ok then
fs.delete(pathname)
fs.delete(pathname..".timestamp")
return nil, "Failed extracting manifest file"
end
pathname = nozip
end
return manif_core.manifest_loader(pathname, repo_url)
Expand Down

0 comments on commit 0402bce

Please sign in to comment.