summaryrefslogtreecommitdiff
path: root/xmake/modules/utils
diff options
context:
space:
mode:
authorruki <[email protected]>2024-08-21 23:42:13 +0800
committerruki <[email protected]>2024-08-21 23:42:13 +0800
commitb5478ed30139e055d3d6d37a77953aea1eaf011d (patch)
treee445b5b0e3650902e3fbad6f47bf4e06677df0ae /xmake/modules/utils
parentde0ade770bc66add05cd3b654acf50bc8b17fe35 (diff)
add cli.archive and cli.extract
Diffstat (limited to 'xmake/modules/utils')
-rw-r--r--xmake/modules/utils/archive/archive_xmz.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/xmake/modules/utils/archive/archive_xmz.lua b/xmake/modules/utils/archive/archive_xmz.lua
index 77e110054..d9cf427c6 100644
--- a/xmake/modules/utils/archive/archive_xmz.lua
+++ b/xmake/modules/utils/archive/archive_xmz.lua
@@ -21,7 +21,7 @@
-- imports
import("core.base.option")
--- archive archive file
+-- archive file
--
-- @param archivefile the archive file. e.g. *.tar.gz, *.zip, *.7z, *.tar.bz2, ..
-- @param inputfiles the input file or directory or list
@@ -29,4 +29,16 @@ import("core.base.option")
--
function main(archivefile, inputfiles, opt)
opt = opt or {}
+ local files = {}
+ for _, inputfile in ipairs(inputfiles) do
+ if os.isdir(inputfile) then
+ table.join2(files, os.files(path.join(inputfile, opt.recurse and "**" or "*")))
+ elseif os.isfile(inputfile) then
+ table.insert(files, inputfile)
+ end
+ end
+ inputfiles = files
+
+ print("archivefile", archivefile)
+ print("inputfiles", inputfiles)
end