Truncate config on writes

Fix for #485.
This commit is contained in:
Adam Bolte 2019-10-21 16:53:36 +11:00
parent a112b072aa
commit ba8d6ac630
No known key found for this signature in database
GPG key ID: E00A5640D5D2A487

View file

@ -270,7 +270,7 @@ module Vagrant
def write_config(contents)
confpath = base_path.join('config').to_s
begin
File.open(confpath, File::RDWR) do |file|
File.open(confpath, File::WRONLY|File::TRUNC) do |file|
file.write contents
end
rescue