Skip to content

Commit

Permalink
need environmental variable on all unix systems
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed May 26, 2024
1 parent fc45755 commit ca7a597
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ca7a597

Please sign in to comment.