How to access MISE_PROJECT_DIR or equivalent information within hook which runs in the current shell (shell is set to zsh)? #4013
-
The docs say that hooks are run with $ cat mise.local.toml [hooks.enter]
shell = "zsh"
script = "typeset -p MISE_PROJECT_DIR" $ cd ..
$ cd -
(eval):typeset:8: no such variable: MISE_PROJECT_DIR |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
shell hooks literally just run the code in your current shell session. It's equivalent to you typing the commands in after mise runs. I don't think there is way to do that without also exposing the env var to your shell. I suppose we could add it then remove it to clean up, but I think the best option is just for you to set a different env var for the project root. |
Beta Was this translation helpful? Give feedback.
Oh! It seems we can use the tera templates in the
script
value, so I can just use{{config_root}}
.Unless I'm missing something, that seems great and this discussion can be closed. Thanks!