Skip to content

Commit

Permalink
fix: show more accurate error if no tasks are available
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Nov 25, 2024
1 parent 79c1a3f commit e1b1b48
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,12 @@ impl Run {
}

fn err_no_task(&self, name: &str) -> Result<()> {
if CONFIG.tasks().is_ok_and(|t| t.is_empty()) {
bail!(
"no tasks defined in {}. Are you in a project directory?",
display_path(dirs::CWD.clone().unwrap_or_default())
);
}
if let Some(cwd) = &*dirs::CWD {
let includes = CONFIG.task_includes_for_dir(cwd);
let path = includes
Expand Down

0 comments on commit e1b1b48

Please sign in to comment.