Open cmmorrow opened 2 years ago
Can i try these.
Feel free to submit a pull request. I've assigned the issue to you and sent you an invitation to the project.
Feel free to submit a pull request. I've assigned the issue to you and sent you an invitation to the proS So by "improperly formatted dotenv file" you are talking about the contents of the .env file right?
Correct, the content of the dotenv file does not contain equal sign separated key value pairs on each line. You can test against a plane text file or binary file like a jpg.
Describe the bug If using the
--dotenv
option from the command-line ordotenv:
in a Config File and providing a file that is not a dotenv file doesn't cause an error. It would be better to let the user know that they provided an improperly formatted instead of continuing with executing commands and potentially failing later.To Reproduce Steps to reproduce the behavior:
build-magic --dotenv [some file] echo hello
where[some file]
is any file that isn't a dotenv file.Expected behavior An improperly formatted dotenv file should raise an error and communicate the impropriety to the user.
Additional context The dotenv file is read and parsed in
cli/parse_dotenv_file()
and the logic simply continues to the next line if it doesn't contain an "=":The checks inside this loop should be replaced with a single step that validates the dotenv file.