Deployment and lifecycle management for Nix
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

activator: avoid stderr interfering with the protocol

+6 -4
+6 -4
cmd/sower-activator/activate.go
··· 135 135 136 136 go func() { 137 137 defer wg.Done() 138 - streamLines(stdout, os.Stdout, callback, false) 138 + streamLines(stdout, nil, callback, false) 139 139 }() 140 140 141 141 go func() { ··· 158 158 return exitCode, nil 159 159 } 160 160 161 - // streamLines reads lines from a reader, writes them to the given writer, 161 + // streamLines reads lines from a reader, optionally mirrors to a writer, 162 162 // and calls the callback for each line. 163 - func streamLines(r io.Reader, w io.Writer, callback OutputCallback, isError bool) { 163 + func streamLines(r io.Reader, mirror io.Writer, callback OutputCallback, isError bool) { 164 164 scanner := bufio.NewScanner(r) 165 165 for scanner.Scan() { 166 166 line := scanner.Text() 167 - fmt.Fprintln(w, line) 167 + if mirror != nil { 168 + fmt.Fprintln(mirror, line) 169 + } 168 170 callback(line, isError) 169 171 } 170 172 }