mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 23:39:56 +01:00
add error handling, name variables more clear
This commit is contained in:
parent
664cb4bbde
commit
6be1f3e4fc
@ -79,20 +79,17 @@ func Readln(r *bufio.Reader) (string, error) {
|
||||
|
||||
func (t *task) logPipe(reader *bufio.Reader) {
|
||||
|
||||
s, e := Readln(reader)
|
||||
for e == nil {
|
||||
t.log(s)
|
||||
s, e = Readln(reader)
|
||||
line, err := Readln(reader)
|
||||
for err == nil {
|
||||
t.log(line)
|
||||
line, err = Readln(reader)
|
||||
}
|
||||
|
||||
/*for reader.Scan() {
|
||||
t.log(reader.Text())
|
||||
}
|
||||
|
||||
if err := reader.Err(); err != nil {
|
||||
t.log("Error scanning input!")
|
||||
if err != nil && err.Error() != "EOF" {
|
||||
fmt.Printf("Failed to read output of command: %s\n", err.Error())
|
||||
panic(err)
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (t *task) logCmd(cmd *exec.Cmd) {
|
||||
|
Loading…
Reference in New Issue
Block a user