diff options
| author | ruki <[email protected]> | 2025-11-26 22:35:21 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-26 22:35:21 +0800 |
| commit | eba4c503ccaf873a87ec1f867ba3dffd98b45800 (patch) | |
| tree | 46f2b411563c64cafb5c30e74208258f57d0f6da /xmake/plugins/pack/batchcmds.lua | |
| parent | fe96cdcbaa858ebcec0935d42b3409487e05e511 (diff) | |
improve app/on_installcmd
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, |
