Skip to content

Commit

Permalink
revert to prior exec/stdio.go
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Dec 24, 2024
1 parent 28bb753 commit 6f02037
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions base/exec/stdio.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ func (st *StdIO) Set(o *StdIO) *StdIO {
func (st *StdIO) SetToOS() *StdIO {
cur := &StdIO{}
cur.SetFromOS()
if sif, ok := st.In.(*os.File); ok {
os.Stdin = sif
} else {
fmt.Printf("In is not an *os.File: %#v\n", st.In)
}
os.Stdout = st.Out.(*os.File)
os.Stderr = st.Err.(*os.File)
os.Stdin = st.In.(*os.File)
return cur
}

Expand Down Expand Up @@ -102,10 +98,13 @@ func IsPipe(rw any) bool {
if rw == nil {
return false
}
_, ok := rw.(io.Writer)
w, ok := rw.(io.Writer)
if !ok {
return false
}
if w == os.Stdout {
return false
}
of, ok := rw.(*os.File)
if !ok {
return false
Expand Down Expand Up @@ -248,9 +247,6 @@ func (st *StdIOState) PopToStart() {
for len(st.InStack) > st.InStart {
st.PopIn()
}
for len(st.PipeIn) > 0 {
CloseReader(st.PipeIn.Pop())
}
}

// ErrIsInOut returns true if the given Err writer is also present
Expand Down

0 comments on commit 6f02037

Please sign in to comment.