Skip to content

Commit

Permalink
Implemented WindowsFile#exist?
Browse files Browse the repository at this point in the history
It was missing and not raising an error, which caused much confusion.

See inspec/inspec#288 for more info.
  • Loading branch information
docwhat committed Dec 4, 2015
1 parent 8dd1acf commit 4209fda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/train/extras/windows_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def content
end

def exist?
nil
return @exist if defined?(@exist)
@exist = @backend.run_command(
"(Test-Path -Path \"#{@spath}\").ToString()").stdout.chomp == 'True'
end

def link_target
Expand Down

0 comments on commit 4209fda

Please sign in to comment.