commands/plugin: list shows version constraints and entrypoints
This commit is contained in:
parent
e231890e7e
commit
561e65ec72
|
@ -16,15 +16,36 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
specs = Vagrant::Plugin::Manager.instance.installed_specs
|
manager = Vagrant::Plugin::Manager.instance
|
||||||
|
plugins = manager.installed_plugins
|
||||||
|
specs = manager.installed_specs
|
||||||
|
|
||||||
# Output!
|
# Output!
|
||||||
if specs.empty?
|
if specs.empty?
|
||||||
env[:ui].info(I18n.t("vagrant.commands.plugin.no_plugins"))
|
env[:ui].info(I18n.t("vagrant.commands.plugin.no_plugins"))
|
||||||
|
return @app.call(env)
|
||||||
end
|
end
|
||||||
|
|
||||||
specs.each do |spec|
|
specs.each do |spec|
|
||||||
env[:ui].info "#{spec.name} (#{spec.version})"
|
env[:ui].info "#{spec.name} (#{spec.version})"
|
||||||
|
|
||||||
|
# Grab the plugin. Note that the check for whether it exists
|
||||||
|
# shouldn't be necessary since installed_specs checks that but
|
||||||
|
# its nice to be certain.
|
||||||
|
plugin = plugins[spec.name]
|
||||||
|
next if !plugin
|
||||||
|
|
||||||
|
if plugin["gem_version"] && plugin["gem_version"] != ""
|
||||||
|
env[:ui].info(I18n.t(
|
||||||
|
"vagrant.commands.plugin.plugin_version",
|
||||||
|
version: plugin["gem_version"]))
|
||||||
|
end
|
||||||
|
|
||||||
|
if plugin["require"] && plugin["require"] != ""
|
||||||
|
env[:ui].info(I18n.t(
|
||||||
|
"vagrant.commands.plugin.plugin_require",
|
||||||
|
require: plugin["require"]))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
|
|
|
@ -919,6 +919,8 @@ en:
|
||||||
Installing license for '%{name}'...
|
Installing license for '%{name}'...
|
||||||
no_plugins: |-
|
no_plugins: |-
|
||||||
No plugins installed.
|
No plugins installed.
|
||||||
|
plugin_require: " - Custom entrypoint: %{require}"
|
||||||
|
plugin_version: " - Version Constraint: %{version}"
|
||||||
installed: |-
|
installed: |-
|
||||||
Installed the plugin '%{name} (%{version})'!
|
Installed the plugin '%{name} (%{version})'!
|
||||||
installing: |-
|
installing: |-
|
||||||
|
|
Loading…
Reference in New Issue