kostya / eye

Process monitoring tool. Inspired from Bluepill and God.
MIT License
1.19k stars 89 forks source link

Accessing current directory path? #210

Open rgaufman opened 6 years ago

rgaufman commented 6 years ago

Hi there,

Normally File.expand_path(__dir__) or File.dirname(__FILE__) would return the current directory. But if I run that in my run.eye file, it returns . - any reason for that? - How would I get the current file's directory path in my eye script?

I also tried:

$current_path = Dir.pwd

Eye.config do
  logger File.join($current_path, './log/eye.log')
end

But the $current_path gets set to /

Strangely, when running eye in the foreground with -f, the path gets expanded correctly.

kostya commented 6 years ago

Config evaluated on eye server, so Dir.pwd is for server. but i wonder __DIR__ and __FILE__ should return current config path, need to test it.