mirror of
https://github.com/verdverm/chatgpt
synced 2024-11-10 13:10:24 +00:00
Merge pull request #5 from ebetica/piped_incorrect
Fix bug for when no input is piped but -q is used
This commit is contained in:
commit
1a77595a42
4
main.go
4
main.go
@ -168,7 +168,9 @@ func main() {
|
|||||||
|
|
||||||
// no args, or interactive... read from stdin
|
// no args, or interactive... read from stdin
|
||||||
// this is mainly for replacing text in vim
|
// this is mainly for replacing text in vim
|
||||||
if len(args) == 0 && !PromptMode {
|
fi, _ := os.Stdin.Stat()
|
||||||
|
inputIsFromPipe = (fi.Mode() & os.ModeCharDevice) == 0
|
||||||
|
if len(args) == 0 && !PromptMode && inputIsFromPipe {
|
||||||
reader := bufio.NewReader(os.Stdin)
|
reader := bufio.NewReader(os.Stdin)
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user