Skip to content

Commit 3b00f33

Browse files
committed
Bug fix: avoid password prompt when env var PGPASSWORD is specified
1 parent c6a1d3c commit 3b00f33

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cmd/pgmetrics/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ func main() {
350350
var o options
351351
o.defaults()
352352
args := o.parse()
353-
if !o.passNone && len(o.input) == 0 {
353+
if !o.passNone && len(o.input) == 0 && os.Getenv("PGPASSWORD") == "" {
354354
fmt.Print("Password: ")
355355
p, err := gopass.GetPasswd()
356356
if err != nil {

0 commit comments

Comments
 (0)