Skip to content

Commit 43862ad

Browse files
committed
store-secret: read up to EOF from stdin
Now that we don't write a newline by ourselves, we also need to allow the EOF signal to terminate a string we're reading from stdin.
1 parent 9fb033b commit 43862ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd_store_secret.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"bufio"
55
"fmt"
6+
"io"
67
"os"
78
"path/filepath"
89

@@ -83,7 +84,7 @@ func (x *storeSecretCommand) Execute(args []string) error {
8384
default:
8485
log("Reading secret from stdin")
8586
secret, err := bufio.NewReader(os.Stdin).ReadString('\n')
86-
if err != nil {
87+
if err != nil && err != io.EOF {
8788
return fmt.Errorf("error reading secret from stdin: %v",
8889
err)
8990
}

0 commit comments

Comments
 (0)