diff options
author | Giteabot <teabot@gitea.io> | 2023-07-17 14:28:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-17 18:28:54 +0000 |
commit | d0325006875b97e494779575f17b7634f6837bbe (patch) | |
tree | 5f066909c0dad9ab02ce359ed99b0f1e321e6f11 /contrib/environment-to-ini/environment-to-ini.go | |
parent | 9159964ada44951ba5ee2a41e7bf2fe6f7f7993f (diff) | |
download | gitea-d0325006875b97e494779575f17b7634f6837bbe.tar.gz gitea-d0325006875b97e494779575f17b7634f6837bbe.zip |
Make environment-to-ini work with INSTALL_LOCK=true (#25926) (#25937)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
fix #25924
Diffstat (limited to 'contrib/environment-to-ini/environment-to-ini.go')
-rw-r--r-- | contrib/environment-to-ini/environment-to-ini.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/environment-to-ini/environment-to-ini.go b/contrib/environment-to-ini/environment-to-ini.go index e472384a95..fb5fb7bdad 100644 --- a/contrib/environment-to-ini/environment-to-ini.go +++ b/contrib/environment-to-ini/environment-to-ini.go @@ -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") |