This changes the pin behavior. It uses the filenames given through
the api, and allows files to be streamed faltly (not a hierarchy),
which is easier for other things (like vinyl in node-ipfs-api land).
Files can also be entirely out of order, and the garbage intermediate
directories will not be pinned (gc-ed later).
The changes also mean the output of add has changed slightly-- it
no longer shows the local path added, but rather the dag path
relative to the added roots. This is a small difference, but changes
tests.
The dagutils.Editor creates a lot of chaff (intermediate objects)
along the way. Wonder how we might minimize the writes to the
datastore...
This commit also removes the "NilRepo()" part of the --only-hash
mode. We need to store at least in an in-mem repo/datastore because
otherwise the dagutils.Editor breaks.
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
There can be non-terminal (i.e. non-interactive) sessions
that are *not* a pipe, for example:
ssh user@host ipfs version
In this case, it looks like we should read from stdin.
Parsing stdin is accomplished by deliberately triggering
the parsing loop once.
We didn't previously check whether there is an ArgDef to support
that loop iteration.
This should fix issue #1196 (Can't launch a command line
process from Qt).
The check was bad because it took stdin into account,
but it really shouldn't.
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
This should fix issue #1141 (ipfs cat "multihash too short"
error when using stdin) and perhaps others.
License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Attention @maybebtc @mappum
I cleaned up + simplified the main flow. Now, all printing
is contained inside main itself! (:cheer:). I do this with
the help of a cmdInvocation struct that has both
a Parse and Run. The only major clunkiness left is that the
"CallCommand" is still its own function. But *shrug*.
Please test it works as we would expect. i changed much of
the flow, so likely that i missed a complicated edge case.
main roadmap:
- parse the commandline to get a cmdInvocation
- if user requests, help, print it and exit.
- run the command invocation
- output the response
- if anything fails, print error, maybe with help