-
Notifications
You must be signed in to change notification settings - Fork 340
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
Use mise tools in env template #1982
Comments
the trouble is people also need some env vars to be loaded before tools. I wonder if maybe we could use |
another idea: [env]
EXAMPLE = {value="{{exec(command='go version')}}", when="after_tools"} |
Oh, that's an interesting idea. I hadn't considered the idea of putting hooks in with the env execution also but in hindsight it makes a lot of sense! |
An example of where this would be helpful at my work: We're using mise to manage our local development environments. We're using FoundationDB with some go bindings that are use cgo to wrap the FoundationDB client libraries. We have foundationdb in the Right now we're using something like this:
But it would be better if we could use something like
or something like that. Side note: Use of |
So the doc exemple: [alias.node]
current = "{{exec(command='node --version')}}" is a bit misleading in the sense that node must not be a mise installed version. I tried it and my terminal just freezes. Should there exists a note in the docs? |
I like this feature. Mise supports I prefer [env]
SETUP_A_VARIABLE = 1
_.source = "./script-to-import-env.sh"
# or run a program to import env
_.run = "./import-env"
[env.post]
# Tools and environment variables are available here
ADDITIONAL_VARIABLE = "30"
ANOTHER_VARIABLE = "{{exec(command='node --version')}}"
# Import additional environment variables or execute commands
_.source = "./run-script-with-more-env.sh"
# or run a program
_.run = "./run-program" |
I think this could be achieved by just using IMO this is a pretty common use case where people use something like Doppler to manage their secrets and would like to implement Another approach could be to more clearly separate toolchain environments from "directory" environments. Maybe keep |
I don't understand it. Perhaps because I don't know Doppler. Can you explain a bit more? Or some samples of how you do it know and what you think how mise should manage Doppler. |
For example, when using Doppler with direnv one would create an export $(doppler secrets download --no-file --format env-no-quotes) This is not possible with mise if we're also using mise to install Hope this clears things up! |
Thanks for the example. I understand using mise like direnv. |
I'd love to be able to use
mise
installed tools to executeenv
exec templates.If I have the following example
.mise.toml
I'd hope that
EXAMPLE
would get populated with the output ofgo version
.Instead I see the following error:
I tried also using
mise exec
to execute the command but that didn't work either.The text was updated successfully, but these errors were encountered: