We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ba8bd1 commit 1d3eefaCopy full SHA for 1d3eefa
age/tui.go
@@ -14,6 +14,7 @@ import (
14
"fmt"
15
"os"
16
"runtime"
17
+ "testing"
18
19
"golang.org/x/term"
20
)
@@ -25,9 +26,11 @@ const (
25
26
// readPassphrase reads a passphrase from the terminal. It does not read from a
27
// non-terminal stdin, so it does not check stdinInUse.
28
func readPassphrase(prompt string) ([]byte, error) {
- password := os.Getenv(SopsAgePasswordEnv)
29
- if password != "" {
30
- return []byte(password), nil
+ if testing.Testing() {
+ password := os.Getenv(SopsAgePasswordEnv)
31
+ if password != "" {
32
+ return []byte(password), nil
33
+ }
34
}
35
36
var in, out *os.File
0 commit comments