Skip to content

Commit

Permalink
Merge branch 'main' into win-test
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx authored Sep 25, 2024
2 parents 07758a2 + 3ac0bf5 commit 500cf1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions e2e/cli/test_run
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ chmod +x .mise/tasks/filetask
mise r --cd "$PWD" configtask arg1 arg2 ::: filetask arg1 arg2
assert "cat test-e2e/test-build-output.txt" "TEST_BUILDSCRIPT_ENV_VAR: VALID
ARGS: arg1 arg2"

assert "mise run test arg1 arg2 arg3" "testing! arg1 arg2 arg3"
3 changes: 2 additions & 1 deletion src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ impl Run {
}
} else {
for (i, script) in task.run.iter().enumerate() {
let args = match parser.has_any_args_defined() && i == task.run.len() - 1 {
// only pass args to the last script if no formal args are defined
let args = match i == task.run.len() - 1 {
true => task.args.iter().cloned().collect_vec(),
false => vec![],
};
Expand Down
4 changes: 2 additions & 2 deletions src/task_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::collections::HashMap;
use std::path::PathBuf;
use std::sync::{Arc, Mutex};

#[derive(Default, Clone)]
#[derive(Debug, Default, Clone)]
pub struct TaskParseArg {
i: usize,
name: String,
Expand All @@ -18,7 +18,7 @@ pub struct TaskParseArg {
// choices: Vec<String>,
}

#[derive(Default)]
#[derive(Debug, Default)]
pub struct TaskParseResults {
scripts: Vec<String>,
args: Vec<TaskParseArg>,
Expand Down

0 comments on commit 500cf1a

Please sign in to comment.