1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-27 12:34:19 +03:00

generate code phrase if not prompted

This commit is contained in:
Zack Scholl 2018-09-21 22:18:41 -07:00
parent 40672a4eaa
commit d555a81d30

View File

@ -7,6 +7,7 @@ import (
"time"
"github.com/schollz/croc/src/croc"
"github.com/schollz/utils"
"github.com/urfave/cli"
)
@ -107,6 +108,10 @@ func send(c *cli.Context) error {
if c.String("code") != "" {
codePhrase = c.String("code")
}
if len(codePhrase) == 0 {
// generate code phrase
codePhrase = utils.GetRandomName()
}
return cr.Send(fname, codePhrase)
}