Class: FluentCommandBuilder::UnixPathFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent_command_builder/internal/path_finders/unix_path_finder.rb

Instance Method Summary collapse

Instance Method Details

#find_path(executable_name) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/fluent_command_builder/internal/path_finders/unix_path_finder.rb', line 4

def find_path(executable_name)
  executable = `which #{executable_name}`
  real_executable = `readlink #{executable}`.strip
  result = real_executable == '' ? executable : real_executable
  return if result.to_s == ''
  File.dirname result
end