summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-11-22 00:52:30 +0800
committerruki <[email protected]>2023-11-22 00:52:30 +0800
commit72eaaf884bd49781a783ea4c65b52e322fb5419d (patch)
tree6a96c4bca6367712ccefa4fd5feabf383db05b2f
parentaccaaf359ff95c1ce88037d80117076af8827b26 (diff)
add rawcmd
-rw-r--r--xmake/modules/private/utils/batchcmds.lua5
-rw-r--r--xmake/plugins/pack/nsis/main.lua2
2 files changed, 7 insertions, 0 deletions
diff --git a/xmake/modules/private/utils/batchcmds.lua b/xmake/modules/private/utils/batchcmds.lua
index eda3887c8..4fa2514c9 100644
--- a/xmake/modules/private/utils/batchcmds.lua
+++ b/xmake/modules/private/utils/batchcmds.lua
@@ -378,6 +378,11 @@ function batchcmds:show(format, ...)
table.insert(self:cmds(), {kind = "show", showtext = showtext})
end
+-- add raw command for the specific generator or xpack format
+function batchcmds:rawcmd(kind, rawstr)
+ table.insert(self:cmds(), {kind = kind, rawstr = rawstr})
+end
+
-- add command: show progress
function batchcmds:show_progress(progress, format, ...)
if progress then
diff --git a/xmake/plugins/pack/nsis/main.lua b/xmake/plugins/pack/nsis/main.lua
index 2016a70d9..282b20a2d 100644
--- a/xmake/plugins/pack/nsis/main.lua
+++ b/xmake/plugins/pack/nsis/main.lua
@@ -137,6 +137,8 @@ function _get_command_strings(package, cmd, opt)
elseif kind == "mkdir" then
local dir = _translate_filepath(package, cmd.dir)
table.insert(result, string.format("CreateDirectory \"%s\"", dir))
+ elseif kind == "nsis" then
+ table.insert(result, cmd.rawstr)
end
return result
end