eye icon indicating copy to clipboard operation
eye copied to clipboard

Accessing current directory path?

Open rgaufman opened this issue 7 years ago • 1 comments

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.

rgaufman avatar Apr 30 '18 23:04 rgaufman

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.

kostya avatar May 01 '18 01:05 kostya