1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-16 20:15:08 +08:00
Files
kubo/cmd/ipfs/mount_unix.go
Brian Tiger Chow 7968b45e58 vendor dependencies with godep
dependencies are vendored into Godeps/_workspace and commit versions are
recorded in Godeps.json

update datastore to e89f0511
update go.crypto
2014-09-09 22:39:42 -07:00

44 lines
1.0 KiB
Go

// +build linux darwin freebsd
package main
import (
"fmt"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
rofs "github.com/jbenet/go-ipfs/fuse/readonly"
u "github.com/jbenet/go-ipfs/util"
)
var cmdIpfsMount = &commander.Command{
UsageLine: "mount",
Short: "Mount an ipfs read-only mountpoint.",
Long: `ipfs mount <os-path> - Mount an ipfs read-only mountpoint.
Mount ipfs at a read-only mountpoint on the OS. All ipfs objects
will be accessible under that directory. Note that the root will
not be listable, as it is virtual. Accessing known paths directly.
`,
Run: mountCmd,
Flag: *flag.NewFlagSet("ipfs-mount", flag.ExitOnError),
}
func mountCmd(c *commander.Command, inp []string) error {
if len(inp) < 1 || len(inp[0]) == 0 {
u.POut(c.Long)
return nil
}
n, err := localNode(true)
if err != nil {
return err
}
mp := inp[0]
fmt.Printf("Mounting at %s\n", mp)
return rofs.Mount(n, mp)
}