diff options
| author | ruki <[email protected]> | 2026-08-14 23:43:47 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-08-14 23:43:47 +0800 |
| commit | 20b14e8b458221555de8b85a32c7185fcf227f48 (patch) | |
| tree | 92098906e907d1aa51d7bfe034a5ef2469ef9857 | |
| parent | 46141dbac176444bd1ed114ea419d4bb8e6d2e13 (diff) | |
improve to addon remove
| -rw-r--r-- | xmake/actions/addon/main.lua | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/xmake/actions/addon/main.lua b/xmake/actions/addon/main.lua index 6a4bd06ca..c5c126bef 100644 --- a/xmake/actions/addon/main.lua +++ b/xmake/actions/addon/main.lua @@ -225,29 +225,30 @@ function _install() end -- remove the given installed addons +-- +-- @note `xrepo remove --addon` removes them in the same way, +-- @see xmake/modules/private/xrepo/action/remove.lua +-- function _remove() local names = option.get("addons") + local force = option.get("force") -- remove all the installed addons? e.g. xmake addon --remove --all - -- - -- @note we remove them one by one, so we can also remove the symlinks safely, - -- and the dependencies between them do not matter, they are all removed - -- if option.get("all") then names = table.keys(addon.addons()) if #names == 0 then - cprint("${color.warning}no installed addons!") + wprint("no installed addons!") return end - for _, name in ipairs(names) do - addon.remove(name, {force = true}) - cprint("${color.success}remove ${bright}%s${clear} ok!", name) - end - return + -- the dependencies between them do not matter, they are all removed + force = true end assert(names, "please specify the addon name to be removed!") - _xrepo("remove", names) + for _, name in ipairs(names) do + addon.remove(name, {force = force}) + cprint("${color.success}remove ${bright}%s${clear} ok!", name) + end end -- upgrade the addons which the current project declares in its `xmake-addons.lua` |
