forked from gitea/gitea
1
0
Fork 0

Make environment-to-ini work with INSTALL_LOCK=true (#25926) (#25937)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
fix #25924
This commit is contained in:
Giteabot 2023-07-17 14:28:54 -04:00 committed by GitHub
parent 9159964ada
commit d032500687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -75,6 +75,8 @@ func main() {
}
func runEnvironmentToIni(c *cli.Context) error {
// the config system may change the environment variables, so get a copy first, to be used later
env := append([]string{}, os.Environ()...)
setting.InitWorkPathAndCfgProvider(os.Getenv, setting.ArgWorkPathAndCustomConf{
WorkPath: c.String("work-path"),
CustomPath: c.String("custom-path"),
@ -86,7 +88,7 @@ func runEnvironmentToIni(c *cli.Context) error {
log.Fatal("Failed to load custom conf '%s': %v", setting.CustomConf, err)
}
changed := setting.EnvironmentToConfig(cfg, os.Environ())
changed := setting.EnvironmentToConfig(cfg, env)
// try to save the config file
destination := c.String("out")