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
16aa6362
Commit
16aa6362
authored
Sep 25, 2014
by
Jeromy
Committed by
Juan Batiz-Benet
Oct 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow ipns to be mounted by mount command
parent
a65e8600
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
cmd/ipfs/mount_unix.go
cmd/ipfs/mount_unix.go
+16
-0
No files found.
cmd/ipfs/mount_unix.go
View file @
16aa6362
...
...
@@ -11,6 +11,7 @@ import (
ma
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
"github.com/jbenet/go-ipfs/daemon"
ipns
"github.com/jbenet/go-ipfs/fuse/ipns"
rofs
"github.com/jbenet/go-ipfs/fuse/readonly"
u
"github.com/jbenet/go-ipfs/util"
)
...
...
@@ -29,6 +30,10 @@ var cmdIpfsMount = &commander.Command{
Flag
:
*
flag
.
NewFlagSet
(
"ipfs-mount"
,
flag
.
ExitOnError
),
}
func
init
()
{
cmdIpfsMount
.
Flag
.
String
(
"n"
,
""
,
"specify a mountpoint for ipns"
)
}
func
mountCmd
(
c
*
commander
.
Command
,
inp
[]
string
)
error
{
if
len
(
inp
)
<
1
||
len
(
inp
[
0
])
==
0
{
u
.
POut
(
c
.
Long
)
...
...
@@ -66,5 +71,16 @@ func mountCmd(c *commander.Command, inp []string) error {
mp
:=
inp
[
0
]
fmt
.
Printf
(
"Mounting at %s
\n
"
,
mp
)
ns
,
ok
:=
c
.
Flag
.
Lookup
(
"n"
)
.
Value
.
Get
()
.
(
string
)
if
ok
{
go
func
()
{
err
=
ipns
.
Mount
(
n
,
ns
,
mp
)
if
err
!=
nil
{
fmt
.
Printf
(
"Error mounting ipns: %s
\n
"
,
err
)
}
}()
}
return
rofs
.
Mount
(
n
,
mp
)
}
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