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 cannot use a dash in its name #13

Open
jakguel opened this issue Mar 13, 2025 · 0 comments
Open

environment variables cannot use a dash in its name #13

jakguel opened this issue Mar 13, 2025 · 0 comments

Comments

@jakguel
Copy link

jakguel commented Mar 13, 2025

Hello Guys

i encountered following problem
My Plugin has a dash in its name, e.g. "my-plugin"
So when i try to set an variable like this in my env:
APPCONF_my-plugin_myvar=1

This will not work in bash/sh or whatever shell. It works in Docker Compose and Kubernetes if you set the env variable there, but thats because docker passes the env variables in a different way.
In my case i needed to run a shell script because of an dependent arithmetic expression as value:
eval export APPCONF_my-plugin_myvar=$(( BLAH + X )) which will result in an error like this :sh: export: APPCONF_my-plugin_myvar: bad variable name

The reason is: dashes are not supported in environment variabel names.
My solution was to echo the output of my expression into a new toml file, and include it into the original config toml

But what would be easier is if wild-config could just replace something like a double underscore "__" into a dash OR if wild-config would just ignore dashes in plugin names if there is not any collision with another plugin

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

1 participant