| 1 | // macFUSE/OSXFUSE availability check. Darwin only. |
| 2 | //go:build darwin && !nofuse |
| 3 | |
| 4 | package node |
| 5 | |
| 6 | import ( |
| 7 | "fmt" |
| 8 | "os" |
| 9 | |
| 10 | core "github.com/ipfs/kubo/core" |
| 11 | ) |
| 12 | |
| 13 | func init() { |
| 14 | platformFuseChecks = darwinFuseCheck |
| 15 | } |
| 16 | |
| 17 | // macFUSE mount helper paths, checked in the same order as go-fuse. |
| 18 | var macFUSEPaths = []string{ |
| 19 | "/Library/Filesystems/macfuse.fs/Contents/Resources/mount_macfuse", |
| 20 | "/Library/Filesystems/osxfuse.fs/Contents/Resources/mount_osxfuse", |
| 21 | } |
| 22 | |
| 23 | func darwinFuseCheck(_ *core.IpfsNode) error { |
| 24 | for _, p := range macFUSEPaths { |
| 25 | if _, err := os.Stat(p); err == nil { |
| 26 | return nil |
| 27 | } |
| 28 | } |
| 29 | return fmt.Errorf(`macFUSE not found. |
| 30 | |
| 31 | macFUSE is required to mount FUSE filesystems on macOS. |
| 32 | Install it from https://osxfuse.github.io/ or via Homebrew: |
| 33 | |
| 34 | brew install macfuse |
| 35 | `) |
| 36 | } |