mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-02 03:28:25 +08:00
check osxfuse version. Fixes #202.
This commit is contained in:
@ -4,6 +4,9 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
|
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
|
||||||
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
|
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
|
||||||
@ -33,6 +36,9 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func mountCmd(c *commander.Command, inp []string) error {
|
func mountCmd(c *commander.Command, inp []string) error {
|
||||||
|
if err := osxFuseCheck(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
cc, err := setupCmdContext(c, true)
|
cc, err := setupCmdContext(c, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -92,3 +98,23 @@ func mountIpns(node *core.IpfsNode, nsdir, fsdir string) <-chan error {
|
|||||||
|
|
||||||
return done
|
return done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func osxFuseCheck() error {
|
||||||
|
// on OSX, check FUSE version.
|
||||||
|
if runtime.GOOS != "darwin" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
ov, err := syscall.Sysctl("osxfuse.version.number")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.HasPrefix(ov, "2.7.") || strings.HasPrefix(ov, "2.8.") {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Errorf("osxfuse version %s not supported.\n%s\n%s", ov,
|
||||||
|
"Older versions of osxfuse have kernel panic bugs; please upgrade!",
|
||||||
|
"https://github.com/jbenet/go-ipfs/issues/177")
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user