diff options
| author | ruki <[email protected]> | 2025-11-26 11:33:49 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-11-26 11:33:49 +0800 |
| commit | e7cd3c2c12d3d51ffef3d2aa9885bfef9db8d650 (patch) | |
| tree | 01bf3737ff18ffb3d6b663c781d2cc9dbd8541d1 /xmake/plugins/pack/batchcmds.lua | |
| parent | 76dc60d1552a0afe1faffd996a36a412e44d548d (diff) | |
| parent | 29ec59fdd5478d14aed635022630a5f1ff492e7c (diff) | |
Merge pull request #7062 from xmake-io/dmg
Add dmg xpack format
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, |
