summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2025-06-06 23:51:24 +0800
committerGitHub <[email protected]>2025-06-06 23:51:24 +0800
commit4ab3e401f14639f14f590fb091187b674cc90fb5 (patch)
treec6f943aec2950c9daad7f94a07f63f925b14487a /xmake/plugins
parentc57e967a612201bf4edee2bdecfd89e08a2afc19 (diff)
Update targets.lua
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/show/lists/targets.lua15
1 files changed, 6 insertions, 9 deletions
diff --git a/xmake/plugins/show/lists/targets.lua b/xmake/plugins/show/lists/targets.lua
index 57cf78b53..fa85de628 100644
--- a/xmake/plugins/show/lists/targets.lua
+++ b/xmake/plugins/show/lists/targets.lua
@@ -28,18 +28,15 @@ import(".showlist")
-- show all targets (optionally filtered by group)
function main()
config.load()
-
- local group_pattern = option.get("group") and ("^" .. path.pattern(option.get("group")) .. "$")
+
local targets = {}
-
+ local group_pattern = option.get("group")
+ if group_pattern then
+ group_pattern = "^" .. path.pattern(group_pattern) .. "$"
+ end
for name, target in pairs(project.targets()) do
local group = target:get("group")
- if (target:is_default() and not group_pattern) or
- (group_pattern and group and (function()
- for component in group:gmatch("[^/\\\\]+") do
- if component:match(group_pattern) then return true end
- end
- end)()) then
+ if (target:is_default() and not group_pattern) or (group_pattern and group and group:match(group_pattern)) then
table.insert(targets, name)
end
end