Improvement on filename() method
When calling Dotenv.configure().filename(F), there is no check if F is an absolute path, leading to always prepending ./, except of course directory() is called with "" as argument.
I don't believe this to be a bug, but this could be improved with a simple check on the filename argument.
Kind regards,
Simon.
@saiema thanks for the ticket. note that filename should not be a file path, but simply a filename. doc
it is used when the name of the .env is something other than .env, for instance env or my-custom-env-file.ext, etc
directory (doc) is help Dotenv find the .env file.
does this help? perhaps some validation to ensure F in filename(F) is not a path may help avoid confusion.
Dear @cdimascio,
I think I misread the filename method's documentation, maybe I thought that the argument was a path when it was just a name.
I don't think a validation in method filename is required, null and non-empty validations would be much better than validating that the argument is not a path. I don't see any code dealing with a null or empty filename.
Kind regards.