diff options
| author | Saikari <[email protected]> | 2026-07-11 06:12:51 +0300 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-07-30 10:17:31 +0800 |
| commit | cb143527bc830df298613ff5a8ff32ee7f6cb9f0 (patch) | |
| tree | 75cb1c98c61329b93bd361d45ca3b1eb2399655d /xmake/modules/private/action/require/impl/actions/install.lua | |
| parent | 20127575d8f48d9b286021c779bdd85090273c39 (diff) | |
fix: enhance plugin management with rollback and confirmation features
Diffstat (limited to 'xmake/modules/private/action/require/impl/actions/install.lua')
| -rw-r--r-- | xmake/modules/private/action/require/impl/actions/install.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua index 3d1c15621..95f424a0f 100644 --- a/xmake/modules/private/action/require/impl/actions/install.lua +++ b/xmake/modules/private/action/require/impl/actions/install.lua @@ -535,6 +535,11 @@ function main(package) test(package) end + -- the plugin has been registered and tested, we can discard the previous backup now + if package:is_plugin() then + plugins.confirm(package:name()) + end + -- leave the package environments os.setenvs(oldenvs) @@ -564,9 +569,9 @@ function main(package) -- leave the package environments os.setenvs(oldenvs) - -- unregister the broken plugin package + -- unregister the broken plugin package and restore the previous version if package:is_plugin() then - plugins.unregister(package:name()) + plugins.rollback(package:name()) end -- copy the invalid package directory to cache |
