mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
fix(windows): avoid inadvertly running exes from cwd (#2885)
On Windows when running commands with their name instead of the path with Command::new, executable with that name from the current working directory will be executed. This PR replaces all instances of Command::new with a new create_command function which will first resolve any executable paths and avoid this issue.
This commit is contained in:
@@ -265,18 +265,6 @@ mod tests {
|
||||
assert!(link.contains("No+Starship+config"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_get_shell_info() {
|
||||
env::remove_var("STARSHIP_SHELL");
|
||||
let unknown_shell = get_shell_info();
|
||||
assert_eq!(UNKNOWN_SHELL, &unknown_shell.name);
|
||||
|
||||
env::set_var("STARSHIP_SHELL", "fish");
|
||||
|
||||
let fish_shell = get_shell_info();
|
||||
assert_eq!("fish", &fish_shell.name);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(windows))]
|
||||
fn test_get_config_path() {
|
||||
|
||||
Reference in New Issue
Block a user