mirror of
https://github.com/rclone/rclone.git
synced 2024-12-28 18:09:01 +01:00
e43b5ce5e5
This is possible now that we no longer support go1.12 and brings rclone into line with standard practices in the Go world. This also removes errors.New and errors.Errorf from lib/errors and prefers the stdlib errors package over lib/errors.
34 lines
950 B
Go
34 lines
950 B
Go
// Build for macos with the brew tag to handle the absence
|
|
// of fuse and print an appropriate error message
|
|
|
|
//go:build brew && darwin
|
|
// +build brew,darwin
|
|
|
|
package cmount
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"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) {
|
|
return nil, nil, errors.New("mount is not supported on MacOS when installed via Homebrew. " +
|
|
"Please install the binaries available at https://rclone." +
|
|
"org/downloads/ instead if you want to use the mount command")
|
|
}
|