Skip to content

Commit

Permalink
fix: bail out of task suggestion if there are no tasks (#1460)
Browse files Browse the repository at this point in the history
  • Loading branch information
roele committed Jan 14, 2024
1 parent 3224f7a commit d52d2ca
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 @@ -332,6 +332,12 @@ impl Run {

fn prompt_for_task(&self, config: &Config, t: &str) -> Result<Task> {
let tasks = config.tasks();
if tasks.is_empty() {
bail!(format!(
"no tasks defined. see {url}",
url = style("https://mise.jdx.dev/tasks/").underlined()
));
}
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 d52d2ca

Please sign in to comment.