vagrant-hostmanager 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,10 +8,14 @@ module VagrantPlugins
|
|
|
8
8
|
|
|
9
9
|
if (machine.communicate.test("uname -s | grep SunOS"))
|
|
10
10
|
realhostfile = '/etc/inet/hosts'
|
|
11
|
+
move_cmd = 'mv'
|
|
12
|
+
elsif (machine.communicate.test("test -d $Env:SystemRoot"))
|
|
13
|
+
realhostfile = 'C:\Windows\System32\Drivers\etc\hosts'
|
|
14
|
+
move_cmd = 'mv -force'
|
|
11
15
|
else
|
|
12
16
|
realhostfile = '/etc/hosts'
|
|
17
|
+
move_cmd = 'mv'
|
|
13
18
|
end
|
|
14
|
-
|
|
15
19
|
# download and modify file with Vagrant-managed entries
|
|
16
20
|
file = @global_env.tmp_path.join("hosts.#{machine.name}")
|
|
17
21
|
machine.communicate.download(realhostfile, file)
|
|
@@ -19,7 +23,7 @@ module VagrantPlugins
|
|
|
19
23
|
|
|
20
24
|
# upload modified file and remove temporary file
|
|
21
25
|
machine.communicate.upload(file, '/tmp/hosts')
|
|
22
|
-
machine.communicate.sudo("
|
|
26
|
+
machine.communicate.sudo("#{move_cmd} /tmp/hosts #{realhostfile}")
|
|
23
27
|
# i have no idea if this is a windows competibility issue or not, but sometimes it dosen't work on my machine
|
|
24
28
|
begin
|
|
25
29
|
FileUtils.rm(file)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vagrant-hostmanager
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.3
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-10-
|
|
12
|
+
date: 2013-10-04 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|