mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
refactor: Maintain single code path for package manager execution (#256)
* refactor: Maintain single code path for package manager execution * fix: Avoid context leak during interactive TTY read * fix: PTY flow handling * fix: Linter fixes
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
//go:build windows
|
||||
|
||||
package pty
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
)
|
||||
|
||||
func readInput(ctx context.Context, src io.Reader, buf []byte) (int, error) {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return 0, ctx.Err()
|
||||
default:
|
||||
return src.Read(buf)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user