mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-10-08 22:52:12 +02:00
- Remove old-style build tags (the +build syntax has become obsolete with 1.17) - Remove redundant build tags from '*_windows.go' files
31 lines
479 B
Go
31 lines
479 B
Go
//go:build !windows
|
|
|
|
package tail
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
"os/exec"
|
|
|
|
"github.com/aybabtme/humanlog"
|
|
)
|
|
|
|
func tailLogsForPlatform(logFilePath string, opts *humanlog.HandlerOptions) {
|
|
cmd := exec.Command("tail", "-f", logFilePath)
|
|
|
|
stdout, _ := cmd.StdoutPipe()
|
|
if err := cmd.Start(); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
if err := humanlog.Scanner(stdout, os.Stdout, opts); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
if err := cmd.Wait(); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
os.Exit(0)
|
|
}
|