Skip to content

Commit

Permalink
return owner for files on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock committed Aug 16, 2016
1 parent 1a38adc commit 1d4ac6f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/train/extras/file_windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ def mounted
nil
end

def owner
owner = @backend.run_command(
"Get-Acl '#{@spath}' | select -expand Owner"
).stdout.strip
return if owner.empty?
owner
end

def type
if attributes.include?('Archive')
return :file
Expand All @@ -61,7 +69,7 @@ def type
end

%w{
mode owner group uid gid mtime size selinux_label
mode group uid gid mtime size selinux_label
}.each do |field|
define_method field.to_sym do
nil
Expand Down

0 comments on commit 1d4ac6f

Please sign in to comment.