You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following error is given via the CLI, even when ~/default.env exists:
$ teller show
Error: failed to open file `~/default.env`
Caused by:
No such file or directory (os error 2)
Location:
/private/tmp/teller-20240519-8895-wwtpqa/teller-2.0.7/teller-cli/src/cli.rs:296:23
It would be great if Teller could parse the default value in order to resolve at least the home directory of the user.
Workarounds
Require the user to define the environment variable
This is not ideal since it requires extra setup by default.
Use Tera template engine
I've found that I can rewrite the .teller.yml file with Terra. My new teller config ends up looking like this:
This does indeed work, since it requires no interpolation.
Note: I added #'s before each of the set lines because it isn't valid yaml and my IDE kept complaining.
Conclusion
If Teller is interested in supporting variable expansion, that would solve this issue nicely.
If not, then the Terra template workaround can work to solve this problem, but there is no clear path to guide a Teller user on how to do this (as a non-rust user, it took me some effort to even figure out that Terra parses the config file.) The documentation could be updated with such a strategy.
If you are interested in a PR being contributed to document the technique, I'd be happy to provide one.
The text was updated successfully, but these errors were encountered:
We use an environment variable to define where to look up the file for the dotenv provider.
We want to set this to default to a specific location in the users home directory (e.g.
~/default.env
) but Teller does not expand~
or$HOME
.Example (does not work):
The following error is given via the CLI, even when
~/default.env
exists:$ teller show Error: failed to open file `~/default.env` Caused by: No such file or directory (os error 2) Location: /private/tmp/teller-20240519-8895-wwtpqa/teller-2.0.7/teller-cli/src/cli.rs:296:23
It would be great if Teller could parse the default value in order to resolve at least the home directory of the user.
Workarounds
Require the user to define the environment variable
This is not ideal since it requires extra setup by default.
Use Tera template engine
I've found that I can rewrite the
.teller.yml
file with Terra. My new teller config ends up looking like this:This does indeed work, since it requires no interpolation.
Note: I added
#
's before each of theset
lines because it isn't valid yaml and my IDE kept complaining.Conclusion
If Teller is interested in supporting variable expansion, that would solve this issue nicely.
If not, then the Terra template workaround can work to solve this problem, but there is no clear path to guide a Teller user on how to do this (as a non-rust user, it took me some effort to even figure out that Terra parses the config file.) The documentation could be updated with such a strategy.
If you are interested in a PR being contributed to document the technique, I'd be happy to provide one.
The text was updated successfully, but these errors were encountered: