zyedidia / eget

Easily install prebuilt binaries from GitHub.
MIT License
954 stars 39 forks source link

Add support for eget environment variable #51

Closed patinthehat closed 1 year ago

patinthehat commented 1 year ago

This PR adds support for EGET_GITHUB_TOKEN as an environment variable containing a GitHub token. If both EGET_GITHUB_TOKEN and GITHUB_TOKEN environment variables are set, EGET_GITHUB_TOKEN is used.

Additionally, the documentation has been updated to reflect this addition.

zyedidia commented 1 year ago

Cool, this seems reasonable, although is it really necessary to have .env file support? I'm not exactly sure what the use case is, rather than just setting the env vars directly when invoking eget.

These new features will also need a small description in the man page.

patinthehat commented 1 year ago

@zyedidia The reason I added .env support is to allow for easier loading of the github token. However, it's not strictly necessary and I can remove it if you prefer (please let me know).
I'll update the docs with info on these addition(s).

If you prefer, I can remove the .env support and submit a separate PR that adds support for a config file; the GitHub token could be defined there, eliminating the need for a .env file. Thoughts?

zyedidia commented 1 year ago

Let's go with removing the .env support from this PR for now, and then look into making a separate options file that can include setting env vars (maybe something like ~/.eget.toml?). I think that may be better since in the future we may want to have config options for other things as well, which can also go in this config file.

patinthehat commented 1 year ago

Let's go with removing the .env support from this PR

@zyedidia Done. The PR title and description have been updated accordingly.

zyedidia commented 1 year ago

Thanks!