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

Run a task when entering a directory #2282

Closed
rmgpinto opened this issue Jun 12, 2024 · 5 comments
Closed

Run a task when entering a directory #2282

rmgpinto opened this issue Jun 12, 2024 · 5 comments

Comments

@rmgpinto
Copy link

I've checked the docs and I'm not 100% sure if this use-case is covered:

I want to automatically run a task (ie: tmuxinator start) when I enter a directory that has a .mise.toml file. It's useful to create/restore a tmux session with the configured layout everytime I switch to a project directory.
I currently use direnv to achieve this and wanted to just rely on mise.

@youcandanch
Copy link

Was just thinking about this today; in my use case, I'd love to be able to install a base set of dependencies into a Python .venv, basically stuff that devs would need to work with the repo itself (thinking things like task runner libs, parsing libs, etc.).

@youcandanch
Copy link

@jdx any thoughts around this one? I'm happy to pick it up as a first contribution, but wanted to spot-check whether or not you'd accept it as functionality before I start crackin' at it.

@jdx
Copy link
Owner

jdx commented Sep 26, 2024

I'm open to it, but I'm not sure how easy it would be. I don't think we have a mechanism to know when a directory is entered right now. I imagine hook-env would need to be altered to look at the previous cwd of the last time it was executed or something.

This is also something that is only possible when not using shims, so we'd need to clearly document that.

@youcandanch
Copy link

Cool. If nothing else, I'm interested in contributing, and it seems like a good -- albeit potentially thorny -- way to get my hands dirty and start feeling out how this all works. If I make any progress on it I'll give ya a shout!

@syhol
Copy link
Contributor

syhol commented Nov 29, 2024

Hooks exists now!

#3256 | https://mise.jdx.dev/hooks.html

@jdx jdx closed this as completed Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants