Compare commits

...

3 Commits

Author SHA1 Message Date
Dylan Hurd
0d46f27a3e fix tests 2025-12-08 11:19:43 -08:00
Dylan Hurd
6e61471b16 rebase 2025-12-08 11:05:43 -08:00
Dylan Hurd
ee1949450e fix(windows) update shell_command parameters 2025-12-08 11:02:30 -08:00
2 changed files with 16 additions and 6 deletions

View File

@@ -41,7 +41,10 @@ impl Shell {
]
}
ShellType::PowerShell => {
let mut args = vec![self.shell_path.to_string_lossy().to_string()];
let mut args = vec![
self.shell_path.to_string_lossy().to_string(),
"-NoLogo".to_string(),
];
if !use_login_shell {
args.push("-NoProfile".to_string());
}
@@ -442,11 +445,17 @@ mod tests {
};
assert_eq!(
test_powershell_shell.derive_exec_args("echo hello", false),
vec!["pwsh.exe", "-NoProfile", "-Command", "echo hello"]
vec![
"pwsh.exe",
"-NoLogo",
"-NoProfile",
"-Command",
"echo hello"
]
);
assert_eq!(
test_powershell_shell.derive_exec_args("echo hello", true),
vec!["pwsh.exe", "-Command", "echo hello"]
vec!["pwsh.exe", "-NoLogo", "-Command", "echo hello"]
);
}

View File

@@ -309,8 +309,9 @@ mod tests {
let command = get_command(&args);
assert_eq!(command.len(), 3);
assert_eq!(command[2], "echo hello");
let expected_command_len = if cfg!(windows) { 4 } else { 3 };
assert_eq!(command.len(), expected_command_len);
assert_eq!(command.last().unwrap(), "echo hello");
}
#[test]
@@ -338,7 +339,7 @@ mod tests {
let command = get_command(&args);
assert_eq!(command[2], "echo hello");
assert_eq!(command.last().unwrap(), "echo hello");
}
#[test]