commands/plugin: uninstall works again
This commit is contained in:
parent
8cfa24143d
commit
e1c9431085
|
@ -67,13 +67,19 @@ module Vagrant
|
||||||
::Bundler::Installer.install(root, definition, opts)
|
::Bundler::Installer.install(root, definition, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Clean up any unused/old gems
|
|
||||||
runtime = ::Bundler::Runtime.new(root, definition)
|
|
||||||
#runtime.clean
|
|
||||||
|
|
||||||
definition.specs
|
definition.specs
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Clean removes any unused gems.
|
||||||
|
def clean(plugins)
|
||||||
|
gemfile = build_gemfile(plugins)
|
||||||
|
lockfile = "#{gemfile.path}.lock"
|
||||||
|
definition = ::Bundler::Definition.build(gemfile, lockfile, nil)
|
||||||
|
root = File.dirname(gemfile.path)
|
||||||
|
runtime = ::Bundler::Runtime.new(root, definition)
|
||||||
|
runtime.clean
|
||||||
|
end
|
||||||
|
|
||||||
# Builds a valid Gemfile for use with Bundler given the list of
|
# Builds a valid Gemfile for use with Bundler given the list of
|
||||||
# plugins.
|
# plugins.
|
||||||
#
|
#
|
||||||
|
|
|
@ -40,6 +40,16 @@ module Vagrant
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Uninstalls the plugin with the given name.
|
||||||
|
#
|
||||||
|
# @param [String] name
|
||||||
|
def uninstall_plugin(name)
|
||||||
|
@global_file.remove_plugin(name)
|
||||||
|
|
||||||
|
# Clean the environment, removing any old plugins
|
||||||
|
Vagrant::Bundler.instance.clean(installed_plugins)
|
||||||
|
end
|
||||||
|
|
||||||
# This returns the list of plugins that should be enabled.
|
# This returns the list of plugins that should be enabled.
|
||||||
#
|
#
|
||||||
# @return [Array<String>]
|
# @return [Array<String>]
|
||||||
|
|
|
@ -13,7 +13,9 @@ module VagrantPlugins
|
||||||
# Remove it!
|
# Remove it!
|
||||||
env[:ui].info(I18n.t("vagrant.commands.plugin.uninstalling",
|
env[:ui].info(I18n.t("vagrant.commands.plugin.uninstalling",
|
||||||
:name => env[:plugin_name]))
|
:name => env[:plugin_name]))
|
||||||
env[:plugin_state_file].remove_plugin(env[:plugin_name])
|
|
||||||
|
manager = Vagrant::Plugin::Manager.instance
|
||||||
|
manager.uninstall_plugin(env[:plugin_name])
|
||||||
|
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue