Skip to content

Commit 4634882

Browse files
committed
return owner for files on windows
1 parent f783018 commit 4634882

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/train/extras/file_windows.rb

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

54+
def owner
55+
owner = @backend.run_command(
56+
"Get-Acl '#{@spath}' | select -expand Owner").stdout.strip
57+
return if owner.empty?
58+
owner
59+
end
60+
5461
def type
5562
if attributes.include?('Archive')
5663
return :file
@@ -61,7 +68,7 @@ def type
6168
end
6269

6370
%w{
64-
mode owner group uid gid mtime size selinux_label
71+
mode group uid gid mtime size selinux_label
6572
}.each do |field|
6673
define_method field.to_sym do
6774
nil

0 commit comments

Comments
 (0)