mirror of
https://github.com/Jguer/yay
synced 2024-09-14 13:51:12 +00:00
Add full support for reading from stdin
Previosuly when reading from stdin we did not redirect back to the real stdin afterwards so it was imposible to interact with y/n questions. Now redirect back to "/dev/tty" just like pacman does.
This commit is contained in:
parent
f1aff7908d
commit
b0961e866d
10
parser.go
10
parser.go
|
@ -560,11 +560,21 @@ func (parser *arguments) parseCommandLine() (err error) {
|
|||
}
|
||||
|
||||
if cmdArgs.existsArg("-") {
|
||||
var file *os.File
|
||||
err = cmdArgs.parseStdin()
|
||||
cmdArgs.delArg("-")
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
file, err = os.Open("/dev/tty")
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
os.Stdin = file
|
||||
}
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue