forked from git-lfs/git-lfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tasklog: check for connected tty on the actual writer
- Loading branch information
1 parent
03aa2ef
commit b40c5cd
Showing
3 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package commands | ||
|
||
import ( | ||
"io" | ||
"os" | ||
) | ||
|
||
type multiWriter struct { | ||
writer io.Writer | ||
fd uintptr | ||
} | ||
|
||
func newMultiWriter(f *os.File, writers ...io.Writer) *multiWriter { | ||
return &multiWriter{ | ||
writer: io.MultiWriter(append([]io.Writer{f}, writers...)...), | ||
fd: f.Fd(), | ||
} | ||
} | ||
|
||
func (w *multiWriter) Write(p []byte) (n int, err error) { | ||
return w.writer.Write(p) | ||
} | ||
|
||
func (w *multiWriter) Fd() uintptr { | ||
return w.fd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters