1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 05:11:06 +02:00

need environmental variable on all unix systems

This commit is contained in:
Zack 2024-05-26 07:20:48 -07:00
parent fc457557e0
commit ca7a5979cc

View file

@ -305,7 +305,7 @@ func send(c *cli.Context) (err error) {
}
// if operating system is UNIX, then use environmental variable to set the code
if (runtime.GOOS == "linux" && c.IsSet("code")) || os.Getenv("CROC_SECRET") != "" {
if (!(runtime.GOOS == "windows") && c.IsSet("code")) || os.Getenv("CROC_SECRET") != "" {
crocOptions.SharedSecret = os.Getenv("CROC_SECRET")
if crocOptions.SharedSecret == "" {
fmt.Printf(`On linux, to send with a custom code phrase,
@ -516,7 +516,7 @@ func receive(c *cli.Context) (err error) {
if crocOptions.SharedSecret == "" && os.Getenv("CROC_SECRET") != "" {
crocOptions.SharedSecret = os.Getenv("CROC_SECRET")
} else if runtime.GOOS == "linux" && crocOptions.SharedSecret != "" {
} else if !(runtime.GOOS == "windows") && crocOptions.SharedSecret != "" {
crocOptions.SharedSecret = os.Getenv("CROC_SECRET")
if crocOptions.SharedSecret == "" {
fmt.Printf(`On linux, to receive with croc you either need