-
Notifications
You must be signed in to change notification settings - Fork 128
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
Allow overriding via env vars custom pages/patches (just like config/cache) #306
Comments
Hmm, when setting relative paths, what would they be relative to? Actually the If absolute paths are a problem, then maybe that's where improvements could be made. Maybe supporting |
Relative to the global config path variable I've set up
Sure, and the least complicated way to improve it is so support env vars, where all of the issues like |
That's a fair point, but like it has been already said, it's a bit difficult for us to decide where to draw the line between "worth having an env var for" and "only needed in config file"; in general, we cannot have all settings accessible only through env vars, because there are too many and we don't want to clutter user's env. But maybe we can resolve all paths through the shell for convenience - if its not too much of a performance hit |
That's fine because env vars don't replace any configuration files, they only allow overriding it, so if users don't want to "clutter" their envs, then they can just... not set any env vars and use the configs Also don't understand re. the performance hit — you're just reading from an environment var, there is no path resolution? |
I suppose we could think about exposing all config settings through the environment. It would be a bit tricky to find the right spot to put this logic in, but could work. The performance hit I am talking about is the reading of lots of environment variables and running all the merging logic - I don't know what to expect there though |
Just to clarify — I'm not asking to expose all config settings, I don't see any point in that |
Well, but only having these seems arbitrary again |
It's not arbitrary, these env solve the issue with relative paths, what issues does having everything solve??? |
Just wanted to chime in – having environment variables for all paths is pretty useful for portable scenarios. With env vars, I can just write a wrapper script that sets the env vars to portable paths and invokes Tealdeer, and it works correctly when I move tealdeer to another path. When the other paths are only configurable in the config file, I must patch them whenever I move Tealdeer, which is much harder to do in a script. If the config file supported relative paths, I could set them once and then just set the single env var, so that would also work for me. |
Yup agree, but as I said, I think we should come up with something unified for all options instead of adding exceptions for particular options now |
Thinking about it a bit more, imo the best solution would be to add support for config-relative paths in the config file, which solves the immediate issue with minimal implementation changes. Do note that the paths must be relative to the config file – adding support for In the longer run, I agree that exposing all config file options in a more scriptable way might be worthwhile, but that's a much more elaborate change. As a sidenote, adding command-line parameters seems better to me than exposing everything using environment variables, since it is easier to use interactively and should have a bit less overhead. |
Sounds good to me, it also seems straightforward to do: Just |
Currently you can override via Environment Variables
Similarly, I'd like to use env vars to override:
To allow using the same config file on various machines/users, since config only accepts absolute paths while it's easier to set relative paths in a shell config
The text was updated successfully, but these errors were encountered: