Skip to content

Commit

Permalink
Fixed when no processes are running
Browse files Browse the repository at this point in the history
  • Loading branch information
savannahostrowski committed Feb 27, 2023
1 parent b44c45b commit ea35631
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func tickCmd() tea.Cmd {
}

func getProcesses() []list.Item {
out, err := exec.Command("lsof", "-i", "-P", "-n", "-sTCP:LISTEN").Output()
out, _ := exec.Command("lsof", "-i", "-P", "-n", "-sTCP:LISTEN").Output()
strStdout := string(out)

procs := strings.Split(strStdout, "\n")
Expand All @@ -201,9 +201,6 @@ func getProcesses() []list.Item {
processes = append(processes, item{title: titleStr, desc: descStr})
}

if err != nil {
log.Error(err.Error())
}
return processes
}

Expand Down

0 comments on commit ea35631

Please sign in to comment.