schollz / croc

Easily and securely send things from one computer to another :crocodile: :package:
https://schollz.com/software/croc6
MIT License
26.79k stars 1.07k forks source link

Gracefully handle non existend receive config file #685

Closed a1lu closed 3 months ago

a1lu commented 3 months ago

This PR is based on https://github.com/schollz/croc/pull/684

As I understand the handling of send.json in the send function, it prints but ignores an error of utils.GetConfigDir(). I tried to copy this behavior to the receive function:

If utils.GetConfigDir() fails, the error is printed and returned to receive. Though, croc only exits if c.Bool("remember") is true, because only then, the config file is really needed.

This may be related to #681

schollz commented 3 months ago

thanks, this looks great!