Skip to content

Commit

Permalink
refactor: modify ShellExecutable.Start to adjust read timeout based o…
Browse files Browse the repository at this point in the history
…n arguments

- Added functionality to remove the first argument when "setLongerReadTimeout" is specified, allowing for a configurable read timeout of 5000ms.
- Enhanced the method's flexibility in handling command-line arguments for improved usability.
  • Loading branch information
ryan-gang committed Dec 30, 2024
1 parent 19eb8c2 commit 070ad50
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/shell_executable/shell_executable.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func (b *ShellExecutable) Start(args ...string) error {
readTimeout := 2000 * time.Millisecond
if len(args) > 0 && args[0] == "setLongerReadTimeout" {
readTimeout = 5000 * time.Millisecond
args = args[1:]

Check failure on line 84 in internal/shell_executable/shell_executable.go

View workflow job for this annotation

GitHub Actions / lint

this value of args is never used (SA4006)
}
b.ptyReader = condition_reader.NewConditionReader(io.TeeReader(b.pty, b.vt), readTimeout)

Expand Down

0 comments on commit 070ad50

Please sign in to comment.