summaryrefslogtreecommitdiff
path: root/xmake/modules/utils/archive/extract.lua
diff options
context:
space:
mode:
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}