diff options
| -rw-r--r-- | xmake/modules/utils/archive/extract.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/modules/utils/archive/extract.lua b/xmake/modules/utils/archive/extract.lua index f8098d834..8a6fbcd02 100644 --- a/xmake/modules/utils/archive/extract.lua +++ b/xmake/modules/utils/archive/extract.lua @@ -371,7 +371,8 @@ 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 @@ -414,7 +415,8 @@ function main(archivefile, outputdir, opt) else extractors = { - [".zip"] = {_extract_using_unzip, _extract_using_tar, _extract_using_7z} + -- 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} , [".7z"] = {_extract_using_7z} , [".gz"] = {_extract_using_gzip, _extract_using_tar, _extract_using_7z} , [".xz"] = {_extract_using_xz, _extract_using_tar, _extract_using_7z} |
