mirror of
https://github.com/schollz/croc.git
synced 2024-12-02 23:22:23 +03:00
need to do chdir in goroutine
This commit is contained in:
parent
034074d7a3
commit
818e590d92
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user