mirror of https://github.com/fiatjaf/nak.git
compile tests again.
This commit is contained in:
parent
b5bd2aecf6
commit
0073c9bdf1
|
@ -17,10 +17,9 @@ import (
|
||||||
|
|
||||||
func call(t *testing.T, cmd string) string {
|
func call(t *testing.T, cmd string) string {
|
||||||
var output strings.Builder
|
var output strings.Builder
|
||||||
stdout = func(a ...any) (int, error) {
|
stdout = func(a ...any) {
|
||||||
output.WriteString(fmt.Sprint(a...))
|
output.WriteString(fmt.Sprint(a...))
|
||||||
output.WriteString("\n")
|
output.WriteString("\n")
|
||||||
return 0, nil
|
|
||||||
}
|
}
|
||||||
err := app.Run(t.Context(), strings.Split(cmd, " "))
|
err := app.Run(t.Context(), strings.Split(cmd, " "))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
|
@ -424,7 +424,7 @@ func askConfirmation(msg string) bool {
|
||||||
}
|
}
|
||||||
defer tty.Close()
|
defer tty.Close()
|
||||||
|
|
||||||
fmt.Fprintf(os.Stderr, color.YellowString(msg))
|
log(color.YellowString(msg))
|
||||||
answer, err := tty.ReadString()
|
answer, err := tty.ReadString()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -139,7 +139,7 @@ func askPassword(msg string, shouldAskAgain func(answer string) bool) (string, e
|
||||||
defer tty.Close()
|
defer tty.Close()
|
||||||
for {
|
for {
|
||||||
// print the prompt to stderr so it's visible to the user
|
// print the prompt to stderr so it's visible to the user
|
||||||
fmt.Fprintf(os.Stderr, color.YellowString(msg))
|
log(color.YellowString(msg))
|
||||||
|
|
||||||
// read password from TTY with masking
|
// read password from TTY with masking
|
||||||
password, err := tty.ReadPassword()
|
password, err := tty.ReadPassword()
|
||||||
|
|
2
mcp.go
2
mcp.go
|
@ -169,7 +169,7 @@ var mcpServer = &cli.Command{
|
||||||
l++
|
l++
|
||||||
pm, _ := sdk.ParseMetadata(result.Event)
|
pm, _ := sdk.ParseMetadata(result.Event)
|
||||||
res.WriteString(fmt.Sprintf("\n\nResult %d\nUser name: \"%s\"\nPublic key: \"%s\"\nDescription: \"%s\"\n",
|
res.WriteString(fmt.Sprintf("\n\nResult %d\nUser name: \"%s\"\nPublic key: \"%s\"\nDescription: \"%s\"\n",
|
||||||
l, pm.ShortName, pm.PubKey.Hex(), pm.About))
|
l, pm.ShortName(), pm.PubKey.Hex(), pm.About))
|
||||||
|
|
||||||
if l >= int(limit) {
|
if l >= int(limit) {
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue