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-unixfs
Commits
74a0aa54
Commit
74a0aa54
authored
Sep 20, 2014
by
Juan Batiz-Benet
Committed by
Brian Tiger Chow
Sep 22, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed [%s] bug
parent
8ed04cfe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
cmd/ipfs/add.go
cmd/ipfs/add.go
+0
-1
core/commands/add.go
core/commands/add.go
+5
-1
No files found.
cmd/ipfs/add.go
View file @
74a0aa54
...
...
@@ -40,7 +40,6 @@ func addCmd(c *commander.Command, inp []string) error {
cmd
:=
daemon
.
NewCommand
()
cmd
.
Command
=
"add"
fmt
.
Println
(
inp
)
cmd
.
Args
=
inp
cmd
.
Opts
[
"r"
]
=
c
.
Flag
.
Lookup
(
"r"
)
.
Value
.
Get
()
err
:=
daemon
.
SendCommand
(
cmd
,
"localhost:12345"
)
...
...
core/commands/add.go
View file @
74a0aa54
package
commands
import
(
"errors"
"fmt"
"io"
"io/ioutil"
...
...
@@ -24,6 +25,9 @@ func Add(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Wr
for
_
,
path
:=
range
args
{
nd
,
err
:=
AddPath
(
n
,
path
,
depth
)
if
err
!=
nil
{
if
err
==
ErrDepthLimitExceeded
&&
depth
==
1
{
err
=
errors
.
New
(
"use -r to recursively add directories."
)
}
return
fmt
.
Errorf
(
"addFile error: %v"
,
err
)
}
...
...
@@ -32,7 +36,7 @@ func Add(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Wr
return
fmt
.
Errorf
(
"addFile error: %v"
,
err
)
}
fmt
.
Fprintf
(
out
,
"
A
dded
node: %s =
%s
\n
"
,
path
,
k
.
Pretty
())
fmt
.
Fprintf
(
out
,
"
a
dded
%s
%s
\n
"
,
k
.
Pretty
()
,
path
)
}
return
nil
}
...
...
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