Skip to content

Commit

Permalink
use stat -c for alpine linux
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock committed Sep 2, 2016
1 parent a2704f6 commit 84f8e4e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/train/extras/stat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ def self.stat(shell_escaped_path, backend, follow_symlink)

def self.linux_stat(shell_escaped_path, backend, follow_symlink)
lstat = follow_symlink ? ' -L' : ''
format = backend.os.esx? ? '-c' : '--printf'
format = (backend.os.esx? || backend.os[:name] == 'alpine') ? '-c' : '--printf'
res = backend.run_command("stat#{lstat} #{shell_escaped_path} 2>/dev/null #{format} '%s\n%f\n%U\n%u\n%G\n%g\n%X\n%Y\n%C'")

# ignore the exit_code: it is != 0 if selinux labels are not supported
# on the system.

Expand Down

0 comments on commit 84f8e4e

Please sign in to comment.