weed mount: mount to the same folder name

This commit is contained in:
Chris Lu 2019-04-10 23:25:41 -07:00
parent 2f76681d62
commit c0d6cc0067

View file

@ -9,6 +9,7 @@ import (
"github.com/spf13/viper" "github.com/spf13/viper"
"os" "os"
"os/user" "os/user"
"path"
"runtime" "runtime"
"strconv" "strconv"
"strings" "strings"
@ -43,6 +44,8 @@ func runMount(cmd *Command, args []string) bool {
mountMode = os.ModeDir | fileInfo.Mode() mountMode = os.ModeDir | fileInfo.Mode()
} }
mountName := path.Base(*mountOptions.dir)
// detect current user // detect current user
uid, gid := uint32(0), uint32(0) uid, gid := uint32(0), uint32(0)
if u, err := user.Current(); err == nil { if u, err := user.Current(); err == nil {
@ -57,7 +60,7 @@ func runMount(cmd *Command, args []string) bool {
util.SetupProfiling(*mountCpuProfile, *mountMemProfile) util.SetupProfiling(*mountCpuProfile, *mountMemProfile)
options := []fuse.MountOption{ options := []fuse.MountOption{
fuse.VolumeName("SeaweedFS"), fuse.VolumeName(mountName),
fuse.FSName("SeaweedFS"), fuse.FSName("SeaweedFS"),
fuse.Subtype("SeaweedFS"), fuse.Subtype("SeaweedFS"),
fuse.NoAppleDouble(), fuse.NoAppleDouble(),