summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2024-08-21 23:57:39 +0800
committerruki <[email protected]>2024-08-21 23:57:39 +0800
commit8c55e952b6ff2c520f4fab685f9b234a5ed194e1 (patch)
treed50db947af65359adaae1428268c7bf99a412b64 /xmake/modules
parentf5ad66b003ca864dfdc047dc75c4f0a016654f5d (diff)
decompress file
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/utils/archive/extract_xmz.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/modules/utils/archive/extract_xmz.lua b/xmake/modules/utils/archive/extract_xmz.lua
index 6dd645a52..1b6cdec04 100644
--- a/xmake/modules/utils/archive/extract_xmz.lua
+++ b/xmake/modules/utils/archive/extract_xmz.lua
@@ -20,6 +20,12 @@
-- imports
import("core.base.option")
+import("core.compress.lz4")
+
+-- decompress file
+function _decompress_file(archivefile, outputfile, opt)
+ lz4.decompress_file(archivefile, outputfile)
+end
-- extract file
--
@@ -29,4 +35,8 @@ import("core.base.option")
--
function main(archivefile, outputdir, opt)
opt = opt or {}
+
+ local archivefile_tmp = os.tmpfile({ramdisk = false})
+ _decompress_file(archivefile, archivefile_tmp)
+ os.tryrm(archivefile_tmp)
end