Execute a task in the directory where it's defined
Closed this issue · 0 comments
I'm currently migrating all my Justfiles to use Mise tasks now that tasks seem to be relatively stable – however, I'm running into one big difference in how tasks behave compared to Just. Whereas just
tasks execute from the same directory as the justfile
they're defined in, Mise executes all tasks from the root of the project where the mise.toml
file is (as per the docs).
My project is a monorepo, and in each package I'm defining a tasks.toml
file with grouped tasks for that package, then importing them all in the top-level mise.toml
file. Unfortunately, to make this work I also need to specify the full relative path of the package via the dir
option for every task in tasks.toml
so I use relative file paths and executables in my task run
field.
It'd be great if there could be a template variable similar to the existing {cwd}
, but instead of using the working directory the user is currently calling the task from, it executes using the directory of the tasks.toml
file.
Hope this all makes sense!