Update local usage to env_local for clarity
This commit is contained in:
parent
84c0aafe71
commit
b71054502e
|
@ -121,9 +121,10 @@ module Vagrant
|
|||
# Installs the list of plugins.
|
||||
#
|
||||
# @param [Hash] plugins
|
||||
# @param [Boolean] env_local Environment local plugin install
|
||||
# @return [Array<Gem::Specification>]
|
||||
def install(plugins, local=false)
|
||||
internal_install(plugins, nil, local: local)
|
||||
def install(plugins, env_local=false)
|
||||
internal_install(plugins, nil, env_local: env_local)
|
||||
end
|
||||
|
||||
# Installs a local '*.gem' file so that Bundler can find it.
|
||||
|
@ -140,7 +141,7 @@ module Vagrant
|
|||
}
|
||||
}
|
||||
@logger.debug("Installing local plugin - #{plugin_info}")
|
||||
internal_install(plugin_info, nil, local: opts[:local])
|
||||
internal_install(plugin_info, nil, env_local: opts[:env_local])
|
||||
plugin_source.spec
|
||||
end
|
||||
|
||||
|
@ -206,7 +207,7 @@ module Vagrant
|
|||
if env_plugin_gem_path
|
||||
# If we are cleaning locally, remove any global specs. If
|
||||
# not, remove any local specs
|
||||
if opts[:local]
|
||||
if opts[:env_local]
|
||||
@logger.debug("Removing specifications that are not environment local")
|
||||
plugin_specs.delete_if do |spec|
|
||||
spec.full_gem_path.to_s.include?(plugin_gem_path.realpath.to_s)
|
||||
|
@ -361,7 +362,7 @@ module Vagrant
|
|||
# as we know the dependencies are satisfied and it will attempt to validate a gem's
|
||||
# dependencies are satisfied by gems in the install directory (which will likely not
|
||||
# be true)
|
||||
install_path = extra[:local] ? env_plugin_gem_path : plugin_gem_path
|
||||
install_path = extra[:env_local] ? env_plugin_gem_path : plugin_gem_path
|
||||
result = request_set.install_into(install_path.to_s, true,
|
||||
ignore_dependencies: true,
|
||||
prerelease: Vagrant.prerelease?,
|
||||
|
|
|
@ -46,7 +46,7 @@ module VagrantPlugins
|
|||
dirs = []
|
||||
|
||||
# Do not include global paths if local only
|
||||
if !env[:local]
|
||||
if !env[:env_local]
|
||||
files << Vagrant::Plugin::Manager.instance.user_file
|
||||
dirs << Vagrant::Bundler.instance.plugin_gem_path
|
||||
end
|
||||
|
|
|
@ -18,7 +18,7 @@ module VagrantPlugins
|
|||
plugin_name = env[:plugin_name]
|
||||
sources = env[:plugin_sources]
|
||||
version = env[:plugin_version]
|
||||
local = env[:plugin_local]
|
||||
env_local = env[:plugin_env_local]
|
||||
|
||||
# Install the gem
|
||||
plugin_name_label = plugin_name
|
||||
|
@ -33,7 +33,7 @@ module VagrantPlugins
|
|||
require: entrypoint,
|
||||
sources: sources,
|
||||
verbose: !!env[:plugin_verbose],
|
||||
local: local
|
||||
env_local: env_local
|
||||
)
|
||||
|
||||
# Record it so we can uninstall if something goes wrong
|
||||
|
|
|
@ -15,7 +15,7 @@ module VagrantPlugins
|
|||
name: env[:plugin_name]))
|
||||
|
||||
manager = Vagrant::Plugin::Manager.instance
|
||||
manager.uninstall_plugin(env[:plugin_name], local: env[:local])
|
||||
manager.uninstall_plugin(env[:plugin_name], env_local: env[:env_local])
|
||||
|
||||
@app.call(env)
|
||||
end
|
||||
|
|
|
@ -17,7 +17,7 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
o.on("--local", "Remove local project plugins only") do |l|
|
||||
options[:local] = l
|
||||
options[:env_local] = l
|
||||
end
|
||||
|
||||
o.on("--reinstall", "Reinstall current plugins after expunge") do |reinstall|
|
||||
|
|
|
@ -20,7 +20,7 @@ module VagrantPlugins
|
|||
build_install_opts(o, options)
|
||||
|
||||
o.on("--local", "Install plugin for local project only") do |l|
|
||||
options[:local] = l
|
||||
options[:env_local] = l
|
||||
end
|
||||
|
||||
o.on("--verbose", "Enable verbose output for plugin installation") do |v|
|
||||
|
@ -33,7 +33,7 @@ module VagrantPlugins
|
|||
return if !argv
|
||||
|
||||
if argv.length < 1
|
||||
raise Vagrant::Errors::CLIInvalidUsage, help: opts.help.chomp if !options[:local]
|
||||
raise Vagrant::Errors::CLIInvalidUsage, help: opts.help.chomp if !options[:env_local]
|
||||
|
||||
errors = @env.vagrantfile.config.vagrant.validate(nil)
|
||||
if !errors["vagrant"].empty?
|
||||
|
@ -61,7 +61,7 @@ module VagrantPlugins
|
|||
plugin_version: info[:version],
|
||||
plugin_sources: info[:sources] || Vagrant::Bundler::DEFAULT_GEM_SOURCES.dup,
|
||||
plugin_name: name,
|
||||
plugin_local: true
|
||||
plugin_env_local: true
|
||||
)
|
||||
end
|
||||
else
|
||||
|
@ -73,7 +73,7 @@ module VagrantPlugins
|
|||
plugin_sources: options[:plugin_sources],
|
||||
plugin_name: name,
|
||||
plugin_verbose: options[:verbose],
|
||||
plugin_local: options[:local]
|
||||
plugin_env_local: options[:env_local]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ module VagrantPlugins
|
|||
o.banner = "Usage: vagrant plugin uninstall <name> [<name2> <name3> ...] [-h]"
|
||||
|
||||
o.on("--local", "Remove plugin from local project") do |l|
|
||||
options[:local] = l
|
||||
options[:env_local] = l
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -23,7 +23,7 @@ module VagrantPlugins
|
|||
|
||||
# Uninstall the gems
|
||||
argv.each do |gem|
|
||||
action(Action.action_uninstall, plugin_name: gem, local: options[:local])
|
||||
action(Action.action_uninstall, plugin_name: gem, env_local: options[:env_local])
|
||||
end
|
||||
|
||||
# Success, exit status 0
|
||||
|
|
Loading…
Reference in New Issue