mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
more strict dir making
This commit is contained in:
1 parent
1d6ee5fbaa
commit
758feaeeb6
2 files changed
+6
-7
No files matched your search
@@ -74,6 +74,11 @@ func initFunc() {
|
||||
params.Config = strings.ReplaceAll(params.Config, "$HOME", h)
|
||||
}
|
||||
}
|
||||
if _, err := os.Stat(params.Config); os.IsNotExist(err) {
|
||||
_ = os.MkdirAll(params.Config, os.ModeDir|0750)
|
||||
} else if err != nil {
|
||||
log.Warn("%v", err)
|
||||
}
|
||||
logWay := "console"
|
||||
if params.LogFile != "" {
|
||||
logWay = "file"
|
||||
|
||||
+1
-7
@@ -189,15 +189,9 @@ func initConfigure() {
|
||||
jsonIteratorExtra.RegisterFuzzyDecoders()
|
||||
|
||||
//db
|
||||
confPath := conf.GetEnvironmentConfig().Config
|
||||
if _, err := os.Stat(confPath); os.IsNotExist(err) {
|
||||
_ = os.MkdirAll(path.Dir(confPath), os.ModeDir|0750)
|
||||
} else if err != nil {
|
||||
log.Warn("%v", err)
|
||||
}
|
||||
if configure.IsConfigureNotExists() {
|
||||
// need to migrate?
|
||||
camp := []string{path.Join(path.Dir(confPath), "v2raya.json"), "/etc/v2ray/v2raya.json", "/etc/v2raya/v2raya.json"}
|
||||
camp := []string{path.Join(conf.GetEnvironmentConfig().Config, "v2raya.json"), "/etc/v2ray/v2raya.json", "/etc/v2raya/v2raya.json"}
|
||||
var success bool
|
||||
for _, jsonConfPath := range camp {
|
||||
if _, err := os.Stat(jsonConfPath); err == nil {
|
||||
|
||||
Reference in new issue
Block a user