Skip to content

Commit 1d4ac6f

Browse files
committed
return owner for files on windows
1 parent 1a38adc commit 1d4ac6f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/train/extras/file_windows.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ def mounted
5151
nil
5252
end
5353

54+
def owner
55+
owner = @backend.run_command(
56+
"Get-Acl '#{@spath}' | select -expand Owner"
57+
).stdout.strip
58+
return if owner.empty?
59+
owner
60+
end
61+
5462
def type
5563
if attributes.include?('Archive')
5664
return :file
@@ -61,7 +69,7 @@ def type
6169
end
6270

6371
%w{
64-
mode owner group uid gid mtime size selinux_label
72+
mode group uid gid mtime size selinux_label
6573
}.each do |field|
6674
define_method field.to_sym do
6775
nil

0 commit comments

Comments
 (0)