hypercore-protocol / hyperdrive-daemon

Hyperdrive, batteries included.
MIT License
156 stars 23 forks source link

`import` command is blocking, but not clear about the why #52

Open mokasin opened 4 years ago

mokasin commented 4 years ago

Describe the bug When importing a directory the command blocks and does not return to the shell. It is unclear, why it does that. Apparently, it lurks around to see if something changes in that directory.

To Reproduce

# hyperdrive import /tmp/foobar
Importing /tmp/foobar into <key> (Ctrl+c to exit)...

Importing | ======================================== | 100% | 1/1 Files

Expected Behavior Either return or better explain what it is doing. Like

File/Folder successfully imported. Watching for further changes (Ctrl +c to stop)...

OS Arch Linux

Node version 13.0.1

Was the daemon installed from NPM or bundled with Beaker? NPM

mokasin commented 4 years ago

Also: When pressing Ctrl+c it tells me

Exit signal received. Stopping upload...

Which does not make perfectly clear (to me) that the files are still seeded and accessible.

andrewosh commented 4 years ago

Hey @mokasin, yeah perhaps the import command shouldn't watch by default -- it currently does. I'll add a more descriptive message. Thanks!

da2x commented 4 years ago

I also want an import command that doesn’t stick around. Suggestions:

andrewosh commented 4 years ago

Yeah @da2x I think I'm just gonna make import not watch by default, as --watch is pretty standard. I'll get this into the next release.