fix: use ; as delimiter on windows for _PR_LIB (github #37)

Co-authored-by: iff <iff@ik.me>
This commit is contained in:
Cody Duong 2025-03-05 16:34:29 -06:00 committed by GitHub
parent 737440869c
commit d76a244a1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 5 deletions

View file

@ -1,5 +1,7 @@
use pay_respects_utils::evals::split_command;
use pay_respects_utils::files::get_path_files;
use pay_respects_utils::files::path_env_sep;
use std::process::{exit, Stdio};
use std::collections::HashMap;
@ -7,6 +9,9 @@ use std::sync::mpsc::channel;
use std::thread;
use std::time::Duration;
#[cfg(windows)]
use pay_respects_utils::files::path_convert;
pub const PRIVILEGE_LIST: [&str; 2] = ["sudo", "doas"];
#[derive(PartialEq)]
@ -112,8 +117,12 @@ impl Data {
}
}
let path = lib_dir.split(':').collect::<Vec<&str>>();
let path = lib_dir.split(path_env_sep()).collect::<Vec<&str>>();
for p in path {
#[cfg(windows)]
let p = path_convert(p);
let files = match std::fs::read_dir(p) {
Ok(files) => files,
Err(_) => continue,