Skip to content

Commit

Permalink
🐛 consistent processes executable for unix and linux (#4934)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev authored Nov 29, 2024
1 parent 4ea1de3 commit 7772dac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions providers/os/resources/processes/unixps.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,17 @@ type ProcessEntry struct {
}

func (p ProcessEntry) ToOSProcess() *OSProcess {
executable := ""
executablePath := ""
args, err := shellquote.Split(p.Command)
if err == nil && len(args) > 0 {
executable = args[0]
executablePath = args[0]
}

executablePathParts := strings.Split(executablePath, "/")
return &OSProcess{
Pid: p.Pid,
Command: p.Command,
Executable: executable,
Executable: executablePathParts[len(executablePathParts)-1],
State: "",
}
}
Expand Down

0 comments on commit 7772dac

Please sign in to comment.