Merge pull request #515 from aluzzardi/secret-term-fix-windows
secret: fix terminal prompt for windows
This commit is contained in:
commit
65da2f1c59
@ -2,7 +2,7 @@ package input
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"syscall"
|
"os"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
@ -30,7 +30,7 @@ var secretCmd = &cobra.Command{
|
|||||||
if len(args) == 1 {
|
if len(args) == 1 {
|
||||||
// No value specified: prompt terminal
|
// No value specified: prompt terminal
|
||||||
fmt.Print("Secret: ")
|
fmt.Print("Secret: ")
|
||||||
data, err := term.ReadPassword(syscall.Stdin)
|
data, err := term.ReadPassword(int(os.Stdin.Fd()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
lg.Fatal().Err(err).Msg("unable to read secret from terminal")
|
lg.Fatal().Err(err).Msg("unable to read secret from terminal")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user