fix: windows path delimiter

This commit is contained in:
iff 2024-11-23 20:22:52 +01:00
parent 1d8d89a61f
commit d4c97333ba

View file

@ -2,6 +2,9 @@ use crate::suggestions::find_similar;
pub fn get_path_files() -> Vec<String> { pub fn get_path_files() -> Vec<String> {
let path = std::env::var("PATH").unwrap(); let path = std::env::var("PATH").unwrap();
#[cfg(target_os = "windows")]
let path = path.split(';').collect::<Vec<&str>>();
#[cfg(not(target_os = "windows"))]
let path = path.split(':').collect::<Vec<&str>>(); let path = path.split(':').collect::<Vec<&str>>();
let mut all_executable = vec![]; let mut all_executable = vec![];
for p in path { for p in path {