Open fiadliel opened 5 days ago
Oh - I found that
# mise dir="{{config_root}}"
does work for changing the current working directory (I was sure I'd tried this, but maybe I tried some variant of it, and it's not really documented).
However, this is not sufficient to make up for the issues with MISE_PROJECT_ROOT
, as one may want to both refer to the project root, and maintain the current working directory.
Yeah I think there are 3 important concepts: cwd, "project root" and config root (which I think is a better default than cwd). I could see the last 2 being different. There is likely work to ensure these all work everywhere and everything.
Describe the bug When running a task defined in
{{dir}}/.mise/tasks/my-script
,MISE_PROJECT_ROOT
is not set if there is no.mise.toml
in{{dir}}
.When running a task in
{{dir}}/.mise/tasks/my-script
,MISE_PROJECT_ROOT
is set to the closest.mise.toml
in the nested paths to the current working directory.To Reproduce Create a hierarchy like
$MISE_PROJECT_ROOT
).Run
mise run my-script
with the current working dir oftest_dir
, no path will be printed. Runmise run my-script
with the current working dir oftest_dir/subdir
, the printed path istest_dir/subdir
.Expected behavior When running a script task in
{{dir}}/.mise/tasks/my-script
:MISE_PROJECT_ROOT
to be{{dir}}
, regardless of the presence or absence of a.mise.toml
in{{dir}}
.MISE_PROJECT_ROOT
to be{{dir}}
, regardless my current working directory, or the existence of a nested directory with its own.mise.toml
, as long as I am executing a script task from the parent mise configuration.mise doctor
outputAdditional context This looks very similar, and/or the same issue as https://github.com/jdx/mise/issues/2335.