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:
parent
40672a4eaa
commit
d555a81d30
5
main.go
5
main.go
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user