fix HasStdin context-init
RELEASE_NOTES=n/a
@@ -6,6 +6,7 @@ import (
"os"
"os/signal"
+ "github.com/gopasspw/gopass/pkg/ctxutil"
"github.com/gopasspw/gopass/pkg/gopass"
"github.com/urfave/cli/v2"
)
@@ -33,6 +34,12 @@ func main() {
}
}()
+ // reading from stdin?
+ if info, err := os.Stdin.Stat(); err == nil && info.Mode()&os.ModeCharDevice == 0 {
+ ctx = ctxutil.WithInteractive(ctx, false)
+ ctx = ctxutil.WithStdin(ctx, true)
+ }
+
gp, err := gopass.New(ctx)
if err != nil {
panic(err)
