1
0
mirror of https://github.com/schollz/croc.git synced 2024-12-11 06:35:01 +03:00

need to do chdir in goroutine

This commit is contained in:
Zack Scholl 2018-10-24 07:19:03 -07:00
parent 034074d7a3
commit 818e590d92

View File

@ -154,16 +154,15 @@ func main() {
return return
} }
// change into the receiving directory
cwd, _ := os.Getwd()
defer os.Chdir(cwd)
os.Chdir(fn)
cr := croc.Init(false) cr := croc.Init(false)
cr.WindowRecipientPrompt = true cr.WindowRecipientPrompt = true
done := make(chan bool) done := make(chan bool)
go func() { go func() {
// change into the receiving directory
cwd, _ := os.Getwd()
defer os.Chdir(cwd)
os.Chdir(fn)
err := cr.Receive(codePhrase) err := cr.Receive(codePhrase)
if err == nil { if err == nil {
open.Run(fn) open.Run(fn)