core: clean up Bundler tempfiles [GH-4103]
This commit is contained in:
parent
15f1823d5c
commit
04835ae612
|
@ -27,6 +27,7 @@ BUG FIXES:
|
|||
but this fixes a few. [GH-4159]
|
||||
- core: Fix crash case when destroying with an invalid provisioner. [GH-4281]
|
||||
- core: Box names with colons work on Windows. [GH-4100]
|
||||
- core: Cleanup all temp files. [GH-4103]
|
||||
- commands/package: base package won't crash with exception [GH-4017]
|
||||
- commands/rsync-auto: Destroyed machines won't raise exceptions. [GH-4031]
|
||||
- communicators/ssh: Nicer error if remote unexpectedly disconects. [GH-4038]
|
||||
|
|
|
@ -103,9 +103,13 @@ env = nil
|
|||
begin
|
||||
require 'log4r'
|
||||
require 'vagrant'
|
||||
require 'vagrant/bundler'
|
||||
require 'vagrant/cli'
|
||||
require 'vagrant/util/platform'
|
||||
|
||||
# Schedule the cleanup of things
|
||||
at_exit(&Vagrant::Bundler.instance.method(:deinit))
|
||||
|
||||
# Create a logger right away
|
||||
logger = Log4r::Logger.new("vagrant::bin::vagrant")
|
||||
logger.info("`vagrant` invoked: #{ARGV.inspect}")
|
||||
|
|
|
@ -77,6 +77,13 @@ module Vagrant
|
|||
Gem.clear_paths
|
||||
end
|
||||
|
||||
# Removes any temporary files created by init
|
||||
def deinit
|
||||
File.unlink(ENV["BUNDLE_APP_CONFIG"]) rescue nil
|
||||
File.unlink(ENV["BUNDLE_CONFIG"]) rescue nil
|
||||
File.unlink(ENV["GEMFILE"]) rescue nil
|
||||
end
|
||||
|
||||
# Installs the list of plugins.
|
||||
#
|
||||
# @param [Hash] plugins
|
||||
|
|
|
@ -53,6 +53,8 @@ module Vagrant
|
|||
Vagrant::Util::Downloader.new(url, tf.path).download!
|
||||
data = JSON.parse(File.read(tf.path))
|
||||
data["version"]
|
||||
ensure
|
||||
tf.unlink if tf
|
||||
end
|
||||
|
||||
# This returns whether or not 3rd party plugins should be loaded.
|
||||
|
|
Loading…
Reference in New Issue