mirror of
https://github.com/fiatjaf/nak.git
synced 2025-09-01 06:20:46 -04:00
fix lineProcessingError() -- it wasn't returning a ctx so it was a noop.
This commit is contained in:
12
encode.go
12
encode.go
@@ -32,7 +32,7 @@ var encode = &cli.Command{
|
||||
Action: func(ctx context.Context, c *cli.Command) error {
|
||||
for target := range getStdinLinesOrArguments(c.Args()) {
|
||||
if ok := nostr.IsValidPublicKey(target); !ok {
|
||||
lineProcessingError(ctx, "invalid public key: %s", target)
|
||||
ctx = lineProcessingError(ctx, "invalid public key: %s", target)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ var encode = &cli.Command{
|
||||
Action: func(ctx context.Context, c *cli.Command) error {
|
||||
for target := range getStdinLinesOrArguments(c.Args()) {
|
||||
if ok := nostr.IsValid32ByteHex(target); !ok {
|
||||
lineProcessingError(ctx, "invalid private key: %s", target)
|
||||
ctx = lineProcessingError(ctx, "invalid private key: %s", target)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ var encode = &cli.Command{
|
||||
Action: func(ctx context.Context, c *cli.Command) error {
|
||||
for target := range getStdinLinesOrArguments(c.Args()) {
|
||||
if ok := nostr.IsValid32ByteHex(target); !ok {
|
||||
lineProcessingError(ctx, "invalid public key: %s", target)
|
||||
ctx = lineProcessingError(ctx, "invalid public key: %s", target)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ var encode = &cli.Command{
|
||||
Action: func(ctx context.Context, c *cli.Command) error {
|
||||
for target := range getStdinLinesOrArguments(c.Args()) {
|
||||
if ok := nostr.IsValid32ByteHex(target); !ok {
|
||||
lineProcessingError(ctx, "invalid event id: %s", target)
|
||||
ctx = lineProcessingError(ctx, "invalid event id: %s", target)
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ var encode = &cli.Command{
|
||||
if d == "" {
|
||||
d = c.String("identifier")
|
||||
if d == "" {
|
||||
lineProcessingError(ctx, "\"d\" tag identifier can't be empty")
|
||||
ctx = lineProcessingError(ctx, "\"d\" tag identifier can't be empty")
|
||||
continue
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ var encode = &cli.Command{
|
||||
Action: func(ctx context.Context, c *cli.Command) error {
|
||||
for target := range getStdinLinesOrArguments(c.Args()) {
|
||||
if ok := nostr.IsValid32ByteHex(target); !ok {
|
||||
lineProcessingError(ctx, "invalid event id: %s", target)
|
||||
ctx = lineProcessingError(ctx, "invalid event id: %s", target)
|
||||
continue
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user