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 ac63068
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/train/extras/file_windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ 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 +68,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 ac63068

Please sign in to comment.