mount_brew.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. //go:build brew && darwin
  2. // Package cmount implements a FUSE mounting system for rclone remotes.
  3. //
  4. // Build for macos with the brew tag to handle the absence
  5. // of fuse and print an appropriate error message
  6. package cmount
  7. import (
  8. "errors"
  9. "github.com/rclone/rclone/cmd/mountlib"
  10. "github.com/rclone/rclone/vfs"
  11. )
  12. func init() {
  13. name := "mount"
  14. cmd := mountlib.NewMountCommand(name, false, mount)
  15. cmd.Aliases = append(cmd.Aliases, "cmount")
  16. mountlib.AddRc("cmount", mount)
  17. }
  18. // mount the file system
  19. //
  20. // The mount point will be ready when this returns.
  21. //
  22. // returns an error, and an error channel for the serve process to
  23. // report an error when fusermount is called.
  24. func mount(_ *vfs.VFS, _ string, _ *mountlib.Options) (<-chan error, func() error, error) {
  25. return nil, nil, errors.New("rclone mount is not supported on MacOS when rclone is installed via Homebrew. " +
  26. "Please install the rclone binaries available at https://rclone.org/downloads/ " +
  27. "instead if you want to use the rclone mount command")
  28. }