Skip to content

Commit

Permalink
fix: bail out of task suggestion if there are no tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
roele committed Jan 14, 2024
1 parent 3224f7a commit a9d197e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ impl Run {

fn prompt_for_task(&self, config: &Config, t: &str) -> Result<Task> {
let tasks = config.tasks();
if tasks.is_empty() {
bail!("no tasks defined in .mise.toml or .mise/tasks/")
}
let task_names = tasks.keys().sorted().collect_vec();
let t = style(&t).yellow().for_stderr();
let msg = format!("no task named `{t}` found. select a task to run:");
Expand Down

0 comments on commit a9d197e

Please sign in to comment.