Skip to content

Commit

Permalink
fix: remove root env var in tasks (#3884)
Browse files Browse the repository at this point in the history
I believe the intention here was for templates but for some reason this was added to env vars. Removing as it can obviously conflict with other env vars.

Fixes #3883

BREAKING CHANGE: you will need to use `{{root}}` or `MISE_PROJECT_ROOT` after this change.
  • Loading branch information
jdx authored Dec 30, 2024
1 parent c8f2c90 commit e306720
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion docs/tasks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The following environment variables are passed to the task:

- `MISE_ORIGINAL_CWD`: The original working directory from where the task was run.
- `MISE_CONFIG_ROOT`: The directory containing the `mise.toml` file where the task was defined or if the config path is something like `~/src/myproj/.config/mise.toml`, it will be `~/src/myproj`.
- `MISE_PROJECT_ROOT` or `root`: The root of the project.
- `MISE_PROJECT_ROOT`: The root of the project.
- `MISE_TASK_NAME`: The name of the task being run.
- `MISE_TASK_DIR`: The directory containing the task script.
- `MISE_TASK_FILE`: The full path to the task script.
1 change: 0 additions & 1 deletion src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ impl Run {
}
if let Some(root) = config.project_root.clone().or(task.config_root.clone()) {
env.insert("MISE_PROJECT_ROOT".into(), root.display().to_string());
env.insert("root".into(), root.display().to_string());
}
env.insert("MISE_TASK_NAME".into(), task.name.clone());
let task_file = task.file.as_ref().unwrap_or(&task.config_source);
Expand Down

0 comments on commit e306720

Please sign in to comment.