mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-05-12 10:58:21 +00:00
fix windows build failing due to syscall
This commit is contained in:
parent
e5c267da42
commit
fe7e6b2a22
1 changed files with 2 additions and 4 deletions
|
@ -9,7 +9,6 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
|
||||||
|
|
||||||
"github.com/passbolt/go-passbolt/api"
|
"github.com/passbolt/go-passbolt/api"
|
||||||
"github.com/passbolt/go-passbolt/helper"
|
"github.com/passbolt/go-passbolt/helper"
|
||||||
|
@ -19,12 +18,11 @@ import (
|
||||||
|
|
||||||
// ReadPassword reads a Password interactively or via Pipe
|
// ReadPassword reads a Password interactively or via Pipe
|
||||||
func ReadPassword() (string, error) {
|
func ReadPassword() (string, error) {
|
||||||
var fd int
|
fd := int(os.Stdin.Fd())
|
||||||
var pass []byte
|
var pass []byte
|
||||||
if term.IsTerminal(syscall.Stdin) {
|
if term.IsTerminal(fd) {
|
||||||
fmt.Print("Enter Password:")
|
fmt.Print("Enter Password:")
|
||||||
|
|
||||||
fd = syscall.Stdin
|
|
||||||
inputPass, err := term.ReadPassword(fd)
|
inputPass, err := term.ReadPassword(fd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
Loading…
Add table
Reference in a new issue