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

Make the executable read .env files properly. #4

Closed
wants to merge 10 commits into from

Conversation

fde-capu
Copy link
Contributor

I identified an issue where navi failed to locate the .env file when running from outside its binary directory. This caused problems for users who prefer not to store the environment variable GEMINI_API_KEY in their .bashrc.

To address this, the program now searches for the .env file within the same directory as the binary itself. This fix should ensure successful retrieval regardless of the execution location.

@fde-capu
Copy link
Contributor Author

fde-capu commented Mar 30, 2024

Following troubleshooting and numerous attempts to resolve the issue, I have successfully imported godotenv, yet the test continues to fail. The failure is attributed to the use of golangci-lint in the build test, which is incompatible with Go 1.19 (despite merging the 'downgrade' PR into this). A potential solution could involve either removing the linting test phase or further downgrading to Go 1.18, which has not been tested by me, and seems awkward.

This PR was intended to simplify the process of configuring the API key. However, it is standard practice to allow end users to manage this configuration. Given the circumstances, it seems the most prudent course of action is to leave the current setup unchanged. Closing this PR.

@fde-capu fde-capu closed this Mar 30, 2024
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

Successfully merging this pull request may close these issues.

1 participant