Add single Unix/Windows path check in process tests

This commit is contained in:
bcmmbaga
2024-03-14 14:32:55 +03:00
parent cc60df7805
commit 9db450d599
2 changed files with 62 additions and 2 deletions

View File

@@ -27,14 +27,14 @@ func (p *ProcessCheck) Check(peer nbpeer.Peer) (bool, error) {
switch peer.Meta.GoOS {
case "darwin", "linux":
for _, process := range p.Processes {
if !slices.Contains(peerActiveProcesses, process.Path) {
if process.Path == "" || !slices.Contains(peerActiveProcesses, process.Path) {
return false, nil
}
}
return true, nil
case "windows":
for _, process := range p.Processes {
if !slices.Contains(peerActiveProcesses, process.WindowsPath) {
if process.WindowsPath == "" || !slices.Contains(peerActiveProcesses, process.WindowsPath) {
return false, nil
}
}