Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored and jdx committed Dec 20, 2024
1 parent 6921b72 commit c69f3f9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 0 additions & 2 deletions e2e/tasks/test_task_options
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ tasks.mytask = 'echo {{option(name="foo")}}'
EOF

assert "mise run mytask --foo bar" "bar"
assert "mise run -- mytask --foo bar" "bar"
assert "mise run mytask -- --foo bar" "bar"
assert "mise mytask --foo bar" "bar"
assert "mise -- mytask --foo bar" "bar"
assert "mise mytask -- --foo bar" "bar"
7 changes: 4 additions & 3 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,11 @@ impl Cli {
external::execute(
&task.into(),
cmd.clone(),
self.task_args.unwrap_or_default().into_iter()
self.task_args
.unwrap_or_default()
.into_iter()
.chain(self.task_args_last)
.collect()
,
.collect(),
)?;
exit(0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ pub fn get_task_lists(args: &[String], prompt: bool) -> Result<Vec<Task>> {
.cloned()
.collect_vec();
if tasks.is_empty() {
if t != "default" || !prompt {
if t != "default" || !prompt || !console::user_attended_stderr() {
err_no_task(&t)?;
}

Expand Down
5 changes: 4 additions & 1 deletion src/cli/use.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::path::{Path, PathBuf};

use console::{style, Term};
use eyre::{eyre, Result};
use eyre::{bail, eyre, Result};
use itertools::Itertools;
use path_absolutize::Absolutize;

Expand Down Expand Up @@ -250,6 +250,9 @@ impl Use {
}

fn tool_selector(&self) -> Result<ToolArg> {
if !console::user_attended_stderr() {
bail!("No tool specified and not running interactively");
}
let mut s = demand::Select::new("Tools")
.description("Select a tool to install")
.filtering(true)
Expand Down

0 comments on commit c69f3f9

Please sign in to comment.