Compare commits

..

No commits in common. "23c8ede5fe77156545662af8df88d4a8c8d9557d" and "43c2d0492b4165971dbf443f5bd06aa1d8235caa" have entirely different histories.

3 changed files with 5 additions and 8 deletions
README.md
lib/vagrant-hostmanager

View File

@ -8,9 +8,6 @@ Vagrant Host Manager
`vagrant-hostmanager` is a Vagrant plugin that manages the `hosts` file on guest machines (and optionally the host). Its goal is to enable resolution of multi-machine environments deployed with a cloud provider where IP addresses are not known in advance. `vagrant-hostmanager` is a Vagrant plugin that manages the `hosts` file on guest machines (and optionally the host). Its goal is to enable resolution of multi-machine environments deployed with a cloud provider where IP addresses are not known in advance.
Do you like what we do? Consider supporting us through Patreon. All of the money goes directly back into growing our collection of open source and free software.
[![Patreon](https://img.shields.io/badge/patreon-donate-red.svg)](https://www.patreon.com/devopsgroup)
Installation Installation
------------ ------------

View File

@ -88,8 +88,8 @@ module VagrantPlugins
def update_content(file_content, resolving_machine, include_id, line_endings) def update_content(file_content, resolving_machine, include_id, line_endings)
id = include_id ? " id: #{read_or_create_id}" : "" id = include_id ? " id: #{read_or_create_id}" : ""
header = "## vagrant-hostmanager-start#{id}" header = "## vagrant-hostmanager-start#{id}\n"
footer = "## vagrant-hostmanager-end" footer = "## vagrant-hostmanager-end\n"
body = get_machines body = get_machines
.map { |machine| get_hosts_file_entry(machine, resolving_machine) } .map { |machine| get_hosts_file_entry(machine, resolving_machine) }
.join .join
@ -146,12 +146,12 @@ module VagrantPlugins
if body.empty? if body.empty?
block = "\n" block = "\n"
else else
block = "\n\n" + header + "\n" + body + footer + "\n\n" block = "\n\n" + header + body + footer + "\n"
end end
# Pattern for finding existing block # Pattern for finding existing block
header_pattern = Regexp.quote(header) header_pattern = Regexp.quote(header)
footer_pattern = Regexp.quote(footer) footer_pattern = Regexp.quote(footer)
pattern = Regexp.new("[\r\n]*#{header_pattern}.*?#{footer_pattern}[\r\n]*", Regexp::MULTILINE) pattern = Regexp.new("\n*#{header_pattern}.*?#{footer_pattern}\n*", Regexp::MULTILINE)
# Replace existing block or append # Replace existing block or append
content = old_content.match(pattern) ? old_content.sub(pattern, block) : old_content.rstrip + block content = old_content.match(pattern) ? old_content.sub(pattern, block) : old_content.rstrip + block
if line_endings == "crlf" if line_endings == "crlf"

View File

@ -1,5 +1,5 @@
module VagrantPlugins module VagrantPlugins
module HostManager module HostManager
VERSION = '1.8.9' VERSION = '1.8.8'
end end
end end