Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
839adbf4
Commit
839adbf4
authored
Dec 17, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dag/get: accept paths and not just cids
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
548490f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
core/commands/dag/dag.go
core/commands/dag/dag.go
+4
-3
No files found.
core/commands/dag/dag.go
View file @
839adbf4
...
...
@@ -6,6 +6,7 @@ import (
"strings"
cmds
"github.com/ipfs/go-ipfs/commands"
path
"github.com/ipfs/go-ipfs/path"
node
"gx/ipfs/QmRSU5EqqWVZSNdbU51yXmVoF1uNw3JgTNB6RaiL7DZM16/go-ipld-node"
ipldcbor
"gx/ipfs/QmbuuwTd9x4NReZ7sxtiKk7wFcfDUo54MfWBdtF5MRCPGR/go-ipld-cbor"
...
...
@@ -105,7 +106,7 @@ var DagGetCmd = &cmds.Command{
`
,
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"
cid
"
,
true
,
false
,
"The
cid of the
object to get"
)
.
EnableStdin
(),
cmds
.
StringArg
(
"
ref
"
,
true
,
false
,
"The object to get"
)
.
EnableStdin
(),
},
Run
:
func
(
req
cmds
.
Request
,
res
cmds
.
Response
)
{
n
,
err
:=
req
.
InvocContext
()
.
GetNode
()
...
...
@@ -114,13 +115,13 @@ var DagGetCmd = &cmds.Command{
return
}
c
,
err
:=
cid
.
Decode
(
req
.
Arguments
()[
0
])
p
,
err
:=
path
.
ParsePath
(
req
.
Arguments
()[
0
])
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
}
obj
,
err
:=
n
.
DAG
.
Get
(
req
.
Context
(),
c
)
obj
,
err
:=
n
.
Resolver
.
ResolvePath
(
req
.
Context
(),
p
)
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment