mirror of https://github.com/schollz/croc.git
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"
|
"time"
|
||||||
|
|
||||||
"github.com/schollz/croc/src/croc"
|
"github.com/schollz/croc/src/croc"
|
||||||
|
"github.com/schollz/utils"
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -107,6 +108,10 @@ func send(c *cli.Context) error {
|
||||||
if c.String("code") != "" {
|
if c.String("code") != "" {
|
||||||
codePhrase = c.String("code")
|
codePhrase = c.String("code")
|
||||||
}
|
}
|
||||||
|
if len(codePhrase) == 0 {
|
||||||
|
// generate code phrase
|
||||||
|
codePhrase = utils.GetRandomName()
|
||||||
|
}
|
||||||
return cr.Send(fname, codePhrase)
|
return cr.Send(fname, codePhrase)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue