From 818e590d924795321ee06d1143552ff465250d16 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 24 Oct 2018 07:19:03 -0700 Subject: [PATCH] need to do chdir in goroutine --- src/win/main.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/win/main.go b/src/win/main.go index 0c1bd0b..f117846 100644 --- a/src/win/main.go +++ b/src/win/main.go @@ -154,16 +154,15 @@ func main() { return } - // change into the receiving directory - cwd, _ := os.Getwd() - defer os.Chdir(cwd) - os.Chdir(fn) - cr := croc.Init(false) cr.WindowRecipientPrompt = true done := make(chan bool) go func() { + // change into the receiving directory + cwd, _ := os.Getwd() + defer os.Chdir(cwd) + os.Chdir(fn) err := cr.Receive(codePhrase) if err == nil { open.Run(fn)