Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing current directory path? #210

Open
rgaufman opened this issue Apr 30, 2018 · 1 comment
Open

Accessing current directory path? #210

rgaufman opened this issue Apr 30, 2018 · 1 comment

Comments

@rgaufman
Copy link

rgaufman commented Apr 30, 2018

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
Copy link
Owner

kostya commented May 1, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants