Skip to content

Commit

Permalink
Do not pass os.Stdin to launched command
Browse files Browse the repository at this point in the history
This is related to getgauge/gauge#2419
- removes problematic line
- references issue in the code
- updates the dependencies in order to get go build and go test working

Signed-off by: Lukas Bockstaller <[email protected]>

Signed-off-by: Lukas Bockstaller <[email protected]>
  • Loading branch information
bockstaller committed Oct 26, 2023
1 parent e0aee1c commit 75196b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions common.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ func CopyFile(src, dest string) error {
return nil
}

//Appends contents of source file to destination file.
// Appends contents of source file to destination file.
// If destination file is not present, Copy file action is performed
func AppendToFile(srcFile, destFile string) error {
if FileExists(destFile) {
Expand Down Expand Up @@ -542,7 +542,9 @@ func prepareCommand(isSystemCommand bool, command []string, workingDir string, o
cmd.Dir = workingDir
cmd.Stdout = outputStreamWriter
cmd.Stderr = errorStreamWriter
cmd.Stdin = os.Stdin
// This function used to pass along os.Stdin like this
// cmd.Stdin = os.Stdin
// This has difficult to track down side effects as discussed here https://github.com/getgauge/gauge/issues/2419
return cmd
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ go 1.13
require (
github.com/dmotylev/goproperties v0.0.0-20140630191356-7cbffbaada47
github.com/go-check/check v0.0.0-20190902080502-41f04d3bba15
github.com/kr/pretty v0.1.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ github.com/go-check/check v0.0.0-20190902080502-41f04d3bba15 h1:xJdCV5uP69sUzCII
github.com/go-check/check v0.0.0-20190902080502-41f04d3bba15/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

0 comments on commit 75196b9

Please sign in to comment.