From f070b5c9e770199d6fd5de9f696b4894238c6b58 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 14 Nov 2023 23:20:28 +0800 Subject: add icon file --- xmake/modules/private/utils/batchcmds.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xmake/modules/private/utils/batchcmds.lua') diff --git a/xmake/modules/private/utils/batchcmds.lua b/xmake/modules/private/utils/batchcmds.lua index 6edd1d8f3..347b40be3 100644 --- a/xmake/modules/private/utils/batchcmds.lua +++ b/xmake/modules/private/utils/batchcmds.lua @@ -144,6 +144,14 @@ function _runcmd_rm(cmd, opt) end end +-- run command: os.rmdir +function _runcmd_rmdir(cmd, opt) + local dir = cmd.dir + if not opt.dryrun and os.isdir(dir) then + os.tryrm(dir) + end +end + -- run command: os.cp function _runcmd_cp(cmd, opt) if not opt.dryrun then @@ -178,6 +186,7 @@ function _runcmd(cmd, opt) execv = _runcmd_execv, vexecv = _runcmd_vexecv, mkdir = _runcmd_mkdir, + rmdir = _runcmd_rmdir, cd = _runcmd_cd, rm = _runcmd_rm, cp = _runcmd_cp, @@ -333,6 +342,11 @@ function batchcmds:mkdir(dir) table.insert(self:cmds(), {kind = "mkdir", dir = dir}) end +-- add command: os.rmdir +function batchcmds:rmdir(dir) + table.insert(self:cmds(), {kind = "rmdir", dir = dir}) +end + -- add command: os.rm function batchcmds:rm(filepath) table.insert(self:cmds(), {kind = "rm", filepath = filepath}) -- cgit v1.3.1