mirror of
https://github.com/fiatjaf/nak.git
synced 2024-11-22 08:19:06 -05:00
Allow setting private key via ENV variable
This commit is contained in:
parent
9f62d4679f
commit
ec2e214c02
|
@ -195,7 +195,13 @@ func gatherSecretKeyOrBunkerFromArguments(ctx context.Context, c *cli.Command) (
|
|||
})
|
||||
return "", bunker, err
|
||||
}
|
||||
|
||||
// Check in the Env for the secret key first
|
||||
sec := c.String("sec")
|
||||
if env, ok := os.LookupEnv("NOSTR_PRIVATE_KEY"); ok {
|
||||
sec = env
|
||||
}
|
||||
|
||||
if c.Bool("prompt-sec") {
|
||||
if isPiped() {
|
||||
return "", nil, fmt.Errorf("can't prompt for a secret key when processing data from a pipe, try again without --prompt-sec")
|
||||
|
|
Loading…
Reference in New Issue
Block a user