summaryrefslogtreecommitdiff
path: root/xmake/modules/utils/archive/extract.lua
diff options
context:
space:
mode:
authorJérôme Leclercq <[email protected]>2022-12-22 11:27:20 +0100
committerGitHub <[email protected]>2022-12-22 11:27:20 +0100
commita221cca45fe6ce74dcf09f8afb5d5335b1ba6962 (patch)
tree15788b9341ee88f9979e68343fd3f5919d3ab2a1 /xmake/modules/utils/archive/extract.lua
parent3424e69c904f8e7f0b43f891bf639a46cb43b133 (diff)
Update extract.lua
Diffstat (limited to 'xmake/modules/utils/archive/extract.lua')
-rw-r--r--xmake/modules/utils/archive/extract.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/modules/utils/archive/extract.lua b/xmake/modules/utils/archive/extract.lua
index 1d7e55efa..0c6affe53 100644
--- a/xmake/modules/utils/archive/extract.lua
+++ b/xmake/modules/utils/archive/extract.lua
@@ -371,7 +371,13 @@ end
-- extract archive file using extractors
function _extract(archivefile, outputdir, extension, extractors, opt)
for _, extract in ipairs(extractors) do
- if extract(archivefile, outputdir, extension, opt) then
+ local ok = try
+ {
+ function ()
+ return extract(archivefile, outputdir, extension, opt)
+ end
+ }
+ if ok then
return true
end
end
@@ -415,7 +421,7 @@ function main(archivefile, outputdir, opt)
extractors =
{
-- tar supports .zip on macOS but does not on Linux
- [".zip"] = is_host("macosx") and {_extract_using_unzip, _extract_using_tar, _extract_using_7z} or {_extract_using_unzip, _extract_using_7z}
+ [".zip"] = is_host("macosx") and {_extract_using_unzip, _extract_using_tar, _extract_using_7z} or {_extract_using_unzip, _extract_using_tar, _extract_using_7z}
, [".7z"] = {_extract_using_7z}
, [".gz"] = {_extract_using_gzip, _extract_using_tar, _extract_using_7z}
, [".xz"] = {_extract_using_xz, _extract_using_tar, _extract_using_7z}