diff options
Diffstat (limited to 'xmake/plugins/pack/batchcmds.lua')
| -rw-r--r-- | xmake/plugins/pack/batchcmds.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/xmake/plugins/pack/batchcmds.lua b/xmake/plugins/pack/batchcmds.lua index b67d66b5b..09b42d7c9 100644 --- a/xmake/plugins/pack/batchcmds.lua +++ b/xmake/plugins/pack/batchcmds.lua @@ -334,6 +334,17 @@ function _on_target_installcmd(target, batchcmds_, opt) return end + -- check if target rules have on_installcmd, use rule's logic first + local done = false + for _, r in ipairs(target:orderules()) do + local on_installcmd = r:script("installcmd") + if on_installcmd then + on_installcmd(target, batchcmds_, opt) + done = true + end + end + if done then return end + -- install target binaries local scripts = { binary = _on_target_installcmd_binary, @@ -416,6 +427,17 @@ function _on_target_uninstallcmd(target, batchcmds_, opt) return end + -- check if target rules have on_uninstallcmd, use rule's logic first + local done = false + for _, r in ipairs(target:orderules()) do + local on_uninstallcmd = r:script("uninstallcmd") + if on_uninstallcmd then + on_uninstallcmd(target, batchcmds_, opt) + done = true + end + end + if done then return end + -- uninstall target binaries local scripts = { binary = _on_target_uninstallcmd_binary, |
