Chris Lu
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
13 additions and
0 deletions
-
weed/command/fuse.go
|
|
@ -23,6 +23,7 @@ func runFuse(cmd *Command, args []string) bool { |
|
|
|
option := strings.Builder{} |
|
|
|
options := []parameter{} |
|
|
|
masterProcess := true |
|
|
|
fusermountPath := "" |
|
|
|
|
|
|
|
// first parameter
|
|
|
|
i := 0 |
|
|
@ -187,6 +188,8 @@ func runFuse(cmd *Command, args []string) bool { |
|
|
|
} else { |
|
|
|
panic(fmt.Errorf("readRetryTime: %s", err)) |
|
|
|
} |
|
|
|
case "fusermount.path": |
|
|
|
fusermountPath = parameter.value |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -213,6 +216,16 @@ func runFuse(cmd *Command, args []string) bool { |
|
|
|
return true |
|
|
|
} |
|
|
|
|
|
|
|
if fusermountPath != "" { |
|
|
|
if err := os.Setenv("PATH", fusermountPath); err != nil { |
|
|
|
panic(fmt.Errorf("setenv: %s", err)) |
|
|
|
} |
|
|
|
} else if os.Getenv("PATH") == "" { |
|
|
|
if err := os.Setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin"); err != nil { |
|
|
|
panic(fmt.Errorf("setenv: %s", err)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// just call "weed mount" command
|
|
|
|
return runMount(cmdMount, []string{}) |
|
|
|
} |
|
|
|