mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
Add custom.ini
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
"github.com/Unknwon/goconfig"
|
||||
)
|
||||
|
||||
@@ -36,11 +37,20 @@ func init() {
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
cfgPath := filepath.Join(workDir, "conf", "app.ini")
|
||||
cfgPathPrefix := filepath.Join(workDir, "conf")
|
||||
cfgPath := filepath.Join(cfgPathPrefix, "app.ini")
|
||||
Cfg, err = goconfig.LoadConfigFile(cfgPath)
|
||||
if err != nil {
|
||||
fmt.Printf("Cannot load config file '%s'\n", cfgPath)
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
cfgPath = filepath.Join(cfgPathPrefix, "custom.ini")
|
||||
if com.IsFile(cfgPath) {
|
||||
if err = Cfg.AppendFiles(cfgPath); err != nil {
|
||||
fmt.Printf("Cannot load config file '%s'\n", cfgPath)
|
||||
os.Exit(2)
|
||||
}
|
||||
}
|
||||
Cfg.BlockMode = false
|
||||
}
|
||||
|
Reference in New Issue
Block a user