guests/nixos: don't detect as Windows [GH-4302]

This commit is contained in:
Mitchell Hashimoto 2014-08-06 11:17:41 -07:00
parent b516881d47
commit 00bd226fc7
3 changed files with 8 additions and 1 deletions

View File

@ -19,6 +19,7 @@ IMPROVEMENTS:
BUG FIXES:
- core: Windows is not detected as NixOS in some cases. [GH-4302]
- core: Fix encoding issues with Windows. There are still some outlying
but this fixes a few. [GH-4159]
- commands/package: base package won't crash with exception [GH-4017]

View File

@ -8,7 +8,7 @@ module VagrantPlugins
# test -f /tmp/afile
# test -L /somelink
# test -x /tmp/some.exe
cmd_parts = command.strip.split(/\s+/)
flag = cmd_parts[1]
path = cmd_parts[2]

View File

@ -4,6 +4,12 @@ module VagrantPlugins
module GuestNixos
class Guest < Vagrant.plugin("2", :guest)
def detect?(machine)
# For some reason our test passes on Windows, so just short
# circuit because we're not Windows.
if machine.config.vm.communicator == :winrm
return false
end
machine.communicate.test("test -f /run/current-system/nixos-version")
end
end