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

Environment Variables example? #93

Open
damccull opened this issue Feb 6, 2023 · 1 comment
Open

Environment Variables example? #93

damccull opened this issue Feb 6, 2023 · 1 comment

Comments

@damccull
Copy link

damccull commented Feb 6, 2023

Hello,

I'm interested in setting up my local mirror such that I can easily enable it by setting one environment variable, or disable it by unsetting it.

I have attempted to set it up as both a registry and a source, but the issue I'm running into is that I need to somehow set source.cargo-io's 'index' value via an environment variable. The docs say I should be able to set CARGO_SOURCE_<sourcename>_INDEX, but I am unsure how to represent the source name here. Using a -, such as CARGO_SOURCE_CRATES-IO_INDEX is invalid under linux, and replacing the dash with a single or double underscore, or omitting it entirely doesn't work.

How can I set the crates-io replacement key via environment variable? This would allow me to set up a source in my config but only to enable it when necessary.

Thanks.

@k3d3
Copy link
Member

k3d3 commented Feb 8, 2023

Unfortunately, I have no idea how to do this. For testing, in ~/.cargo I've just had a config.toml (with nothing in it) and a config file, and just moving the latter to config.bak whenever I didn't want to use the mirror. It's pretty hacky though.

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