diff --git a/e2e/tasks/test_task_unnest b/e2e/tasks/test_task_unnest deleted file mode 100644 index a10fbed98a..0000000000 --- a/e2e/tasks/test_task_unnest +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -cat <.mise.toml -[tasks.a] -run = 'echo a' -[tasks.b] -run = ['echo b && mise run a'] -EOF - -assert "mise run --output prefix b" "\ -[b] b -[a] a" - -cat <.mise.toml -[tasks.a] -run = 'echo a' -[tasks.b] -run = ['echo b && mise run a'] -[tasks.c] -run = ['echo c && mise run b'] -EOF - -assert "mise run --output prefix c" "\ -[c] c -[b] b -[a] a" - -assert "mise run --no-timings --output prefix c 2>&1" '[c] $ echo c && mise run b -[c] c -[b] $ echo b && mise run a -[b] b -[a] $ echo a -[a] a' diff --git a/src/cli/run.rs b/src/cli/run.rs index 0a86371a36..91393af62c 100644 --- a/src/cli/run.rs +++ b/src/cli/run.rs @@ -555,7 +555,7 @@ impl Run { } } } - if this.timings() && num_tasks > 1 && *env::MISE_TASK_LEVEL == 0 { + if this.timings() && num_tasks > 1 { let msg = format!("Finished in {}", time::format_duration(timer.elapsed())); eprintln!("{}", style::edim(msg)); }; @@ -621,12 +621,6 @@ impl Run { let mut env = task.render_env(config, &ts).await?; let output = self.output(Some(task)); env.insert("MISE_TASK_OUTPUT".into(), output.to_string()); - if output == TaskOutput::Prefix { - env.insert( - "MISE_TASK_LEVEL".into(), - (*env::MISE_TASK_LEVEL + 1).to_string(), - ); - } if !self.timings { env.insert("MISE_TASK_TIMINGS".to_string(), "0".to_string()); } diff --git a/src/env.rs b/src/env.rs index 18237b3265..3527b67382 100644 --- a/src/env.rs +++ b/src/env.rs @@ -157,7 +157,6 @@ pub static MISE_IGNORED_CONFIG_PATHS: Lazy> = Lazy::new(|| { }) .unwrap_or_default() }); -pub static MISE_TASK_LEVEL: Lazy = Lazy::new(|| var_u8("MISE_TASK_LEVEL")); pub static MISE_USE_TOML: Lazy = Lazy::new(|| !var_is_false("MISE_USE_TOML")); pub static MISE_LIST_ALL_VERSIONS: Lazy = Lazy::new(|| var_is_true("MISE_LIST_ALL_VERSIONS")); pub static ARGV0: Lazy = Lazy::new(|| ARGS.read().unwrap()[0].to_string()); diff --git a/src/output.rs b/src/output.rs index 3d511061f5..ed9213be2b 100644 --- a/src/output.rs +++ b/src/output.rs @@ -1,41 +1,19 @@ -use regex::Regex; use std::collections::HashSet; use std::sync::LazyLock; use std::sync::Mutex; -pub static UNNEST_RE: LazyLock = - LazyLock::new(|| Regex::new(r#"MISE_TASK_UNNEST:(\d+):MISE_TASK_UNNEST (.*)"#).unwrap()); - #[macro_export] macro_rules! prefix_println { ($prefix:expr, $($arg:tt)*) => {{ let msg = format!($($arg)*); - if let Some(msg) = $crate::output::UNNEST_RE.captures(&msg) { - let level = msg.get(1).unwrap().as_str().parse::().unwrap(); - if level > 1 { - println!("MISE_TASK_UNNEST:{}:MISE_TASK_UNNEST {}", level - 1, msg.get(2).unwrap().as_str()); - } else { - println!("{}", msg.get(2).unwrap().as_str()); - } - } else { - println!("{} {}", $prefix, msg); - } + println!("{} {}", $prefix, msg); }}; } #[macro_export] macro_rules! prefix_eprintln { ($prefix:expr, $($arg:tt)*) => {{ let msg = format!($($arg)*); - if let Some(msg) = $crate::output::UNNEST_RE.captures(&msg) { - let level = msg.get(1).unwrap().as_str().parse::().unwrap(); - if level > 1 { - eprintln!("MISE_TASK_UNNEST:{}:MISE_TASK_UNNEST {}", level - 1, msg.get(2).unwrap().as_str()); - } else { - eprintln!("{}", msg.get(2).unwrap().as_str()); - } - } else { - eprintln!("{} {}", $prefix, msg); - } + eprintln!("{} {}", $prefix, msg); }}; } diff --git a/src/task/mod.rs b/src/task/mod.rs index 801f1514b3..9dcc03bd3e 100644 --- a/src/task/mod.rs +++ b/src/task/mod.rs @@ -500,15 +500,8 @@ impl Task { ] }); let idx = self.display_name.chars().map(|c| c as usize).sum::() % COLORS.len(); - let prefix = style::ereset() + &style::estyle(self.prefix()).fg(COLORS[idx]).to_string(); - if *env::MISE_TASK_LEVEL > 0 { - format!( - "MISE_TASK_UNNEST:{}:MISE_TASK_UNNEST {prefix}", - *env::MISE_TASK_LEVEL - ) - } else { - prefix - } + + style::ereset() + &style::estyle(self.prefix()).fg(COLORS[idx]).to_string() } pub async fn dir(&self, config: &Arc) -> Result> {