Commit 052d387a authored by Matt Bell's avatar Matt Bell

core/commands2: Fixed 'block' command for req.Files() API

parent 3a9a62eb
......@@ -2,7 +2,6 @@ package commands
import (
"bytes"
"io"
"io/ioutil"
"time"
......@@ -97,12 +96,17 @@ It reads from stdin, and <key> is a base58 encoded multihash.
return nil, err
}
in, ok := req.Arguments()[0].(io.Reader)
if !ok {
return nil, u.ErrCast()
file, err := req.Files().NextFile()
if err != nil {
return nil, err
}
data, err := ioutil.ReadAll(file)
if err != nil {
return nil, err
}
data, err := ioutil.ReadAll(in)
err = file.Close()
if err != nil {
return nil, err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment