Browse Source
Merge pull request #2160 from thephoenixofthevoid/thephoenixofthevoid-fix-losing-env
pull/2179/head
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
3 additions and
6 deletions
-
weed/command/fuse.go
|
|
@ -196,6 +196,8 @@ func runFuse(cmd *Command, args []string) bool { |
|
|
|
argv := append(os.Args, "-o", "child") |
|
|
|
|
|
|
|
attr := os.ProcAttr{} |
|
|
|
attr.Env = os.Environ() |
|
|
|
|
|
|
|
child, err := os.StartProcess(arg0, argv, &attr) |
|
|
|
|
|
|
|
if err != nil { |
|
|
@ -211,11 +213,6 @@ func runFuse(cmd *Command, args []string) bool { |
|
|
|
return true |
|
|
|
} |
|
|
|
|
|
|
|
// I don't know why PATH environment variable is lost
|
|
|
|
if err := os.Setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"); err != nil { |
|
|
|
panic(fmt.Errorf("setenv: %s", err)) |
|
|
|
} |
|
|
|
|
|
|
|
// just call "weed mount" command
|
|
|
|
return runMount(cmdMount, []string{}) |
|
|
|
} |
|
|
|