diff options
| author | ruki <[email protected]> | 2026-08-12 00:35:48 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-08-12 00:35:48 +0800 |
| commit | 56a581b37b3c4e7d8b96415a03f850db827956ab (patch) | |
| tree | df58b1231679ed59d9266ae792b21fe7f5b7c3de /xmake/core/package/addon.lua | |
| parent | 6b35c254f0f918c05989b7e62cfd8bca87cc97b5 (diff) | |
improve addon and comment
Diffstat (limited to 'xmake/core/package/addon.lua')
| -rw-r--r-- | xmake/core/package/addon.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/xmake/core/package/addon.lua b/xmake/core/package/addon.lua index 1f116bcd4..586a3ea15 100644 --- a/xmake/core/package/addon.lua +++ b/xmake/core/package/addon.lua @@ -166,11 +166,14 @@ function addon._check_conflicts(dirname, addoninfo) end end - -- the global modules can also conflict with the builtin ones + -- the global modules can also conflict with the builtin and the user modules for _, name in ipairs(addoninfo.globalmodules or {}) do - local modulefile = path.join(os.programdir(), "modules", (name:gsub("%.", "/")) .. ".lua") - if os.isfile(modulefile) then - return string.format("global module(%s) conflicts, it has been provided by xmake!\nplease rename it in the addon manifest.", name) + local modulepath = (name:gsub("%.", "/")) .. ".lua" + for _, moduledir in ipairs({os.programdir(), global.directory()}) do + if os.isfile(path.join(moduledir, "modules", modulepath)) then + return string.format("global module(%s) conflicts, it has been provided by %s!\nplease rename it in the addon manifest.", + name, moduledir == os.programdir() and "xmake" or path.join(moduledir, "modules")) + end end end end |
