core/box_collection: Ensure removal
The docs for Ruby say Pathname#rmtree will recursively delete, but apparently that is a lie, at least on Windows (see GH-7496). Switch to using FileUtils to ensure the directory is deleted. Fixes GH-7496
This commit is contained in:
parent
5650896732
commit
23e50c98f9
|
@ -1,4 +1,5 @@
|
||||||
require "digest/sha1"
|
require "digest/sha1"
|
||||||
|
require "fileutils"
|
||||||
require "monitor"
|
require "monitor"
|
||||||
require "tmpdir"
|
require "tmpdir"
|
||||||
|
|
||||||
|
@ -447,7 +448,7 @@ module Vagrant
|
||||||
|
|
||||||
yield dir
|
yield dir
|
||||||
ensure
|
ensure
|
||||||
dir.rmtree if dir.exist?
|
FileUtils.rm_rf(dir.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Checks if a box with a given name exists.
|
# Checks if a box with a given name exists.
|
||||||
|
|
Loading…
Reference in New Issue