mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
chore: better env parsing
This commit is contained in:
parent
d0c0924e6c
commit
a8adc7cd36
|
@ -6,6 +6,7 @@ import (
|
|||
"os"
|
||||
P "path"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -22,7 +23,7 @@ var Path = func() *path {
|
|||
if err != nil {
|
||||
homeDir, _ = os.Getwd()
|
||||
}
|
||||
allowUnsafePath := strings.TrimSpace(os.Getenv("SKIP_SAFE_PATH_CHECK")) == "1"
|
||||
allowUnsafePath, _ := strconv.ParseBool(os.Getenv("SKIP_SAFE_PATH_CHECK"))
|
||||
homeDir = P.Join(homeDir, ".config", Name)
|
||||
return &path{homeDir: homeDir, configFile: "config.yaml", allowUnsafePath: allowUnsafePath}
|
||||
}()
|
||||
|
|
Loading…
Reference in New Issue
Block a user