2025-12-22 06:08:56 -05:00
|
|
|
# Copyright IBM Corp. 2010, 2025
|
2023-08-10 16:53:25 -04:00
|
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
2013-02-03 13:47:01 -05:00
|
|
|
module VagrantPlugins
|
|
|
|
|
module CommandPlugin
|
|
|
|
|
module Action
|
|
|
|
|
# This middleware uninstalls a plugin by simply removing it from
|
|
|
|
|
# the state file. Running a {PruneGems} after should properly remove
|
|
|
|
|
# it from the gem index.
|
|
|
|
|
class UninstallPlugin
|
|
|
|
|
def initialize(app, env)
|
|
|
|
|
@app = app
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def call(env)
|
|
|
|
|
# Remove it!
|
|
|
|
|
env[:ui].info(I18n.t("vagrant.commands.plugin.uninstalling",
|
2014-05-22 12:35:12 -04:00
|
|
|
name: env[:plugin_name]))
|
2014-01-05 19:02:00 -05:00
|
|
|
|
|
|
|
|
manager = Vagrant::Plugin::Manager.instance
|
2018-06-25 18:57:32 -04:00
|
|
|
manager.uninstall_plugin(env[:plugin_name], env_local: env[:env_local])
|
2013-02-03 13:47:01 -05:00
|
|
|
|
|
|
|
|
@app.call(env)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|