fix(scoop): detect shims correctly w/ sysinfo 0.30

This commit is a fix that handles a subtle breaking change in
sysinfo::Process:root() which no longer can be used to see if a process
is a scoop shim.

Instead we can stringify the executable path and see if the absolute exe
path contains the substring "shims".

With this fix duplicate process detection is once again working
correctly.
This commit is contained in:
LGUG2Z
2024-02-15 17:52:56 -08:00
parent 380971edee
commit 0e14f25130

View File

@@ -482,8 +482,8 @@ fn main() -> Result<()> {
if matched_procs.len() > 1 {
let mut len = matched_procs.len();
for proc in matched_procs {
if let Some(root) = proc.root() {
if root.ends_with("shims") {
if let Some(executable_path) = proc.exe() {
if executable_path.to_string_lossy().contains("shims") {
len -= 1;
}
}