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
1 changed files with 5 additions and 0 deletions

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)
}