2021-09-09 12:25:25 +00:00
|
|
|
//go:build brew && darwin
|
2020-11-17 17:03:12 +00:00
|
|
|
|
2022-08-28 11:21:57 +00:00
|
|
|
// Package cmount implements a FUSE mounting system for rclone remotes.
|
|
|
|
//
|
|
|
|
// Build for macos with the brew tag to handle the absence
|
|
|
|
// of fuse and print an appropriate error message
|
2020-11-17 17:03:12 +00:00
|
|
|
package cmount
|
|
|
|
|
|
|
|
import (
|
2021-11-04 10:12:57 +00:00
|
|
|
"errors"
|
2022-08-05 15:35:41 +00:00
|
|
|
|
2020-11-17 17:03:12 +00:00
|
|
|
"github.com/rclone/rclone/cmd/mountlib"
|
|
|
|
"github.com/rclone/rclone/vfs"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
name := "mount"
|
|
|
|
cmd := mountlib.NewMountCommand(name, false, mount)
|
|
|
|
cmd.Aliases = append(cmd.Aliases, "cmount")
|
|
|
|
mountlib.AddRc("cmount", mount)
|
|
|
|
}
|
|
|
|
|
|
|
|
// mount the file system
|
|
|
|
//
|
|
|
|
// The mount point will be ready when this returns.
|
|
|
|
//
|
|
|
|
// returns an error, and an error channel for the serve process to
|
|
|
|
// report an error when fusermount is called.
|
|
|
|
func mount(_ *vfs.VFS, _ string, _ *mountlib.Options) (<-chan error, func() error, error) {
|
2023-03-29 12:56:35 +00:00
|
|
|
return nil, nil, errors.New("rclone mount is not supported on MacOS when rclone is installed via Homebrew. " +
|
|
|
|
"Please install the rclone binaries available at https://rclone.org/downloads/ " +
|
|
|
|
"instead if you want to use the rclone mount command")
|
2020-11-17 17:03:12 +00:00
|
|
|
}
|