vagrant-vmhosts 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -8,13 +8,15 @@ module VagrantVmHosts
|
|
8
8
|
@app.call(env)
|
9
9
|
|
10
10
|
hosts = env[:vm].config.vmhosts.list
|
11
|
-
|
12
|
-
hosts.
|
13
|
-
|
14
|
-
|
11
|
+
|
12
|
+
if !hosts.empty?
|
13
|
+
env[:ui].info I18n.t("vagrant.plugins.vmhosts.adding")
|
14
|
+
hosts.each do |host|
|
15
|
+
if !env[:vm].channel.test("grep '^#{host['ip']}[[:space:]]' /etc/hosts")
|
16
|
+
env[:vm].channel.sudo("printf '%s\t%s %s\n' '#{host['ip']}' '#{host['canonical']}' '#{host['aliases'].join(' ')}' >> /etc/hosts")
|
17
|
+
end
|
15
18
|
end
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
19
22
|
end
|
20
|
-
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-vmhosts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kristof Willaert
|