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 committed 2024-02-15 17:54:03 -08:00
1 parent 380971edee
commit 0e14f25130
1 file changed
+2 -2
+2 -2
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;
}
}