mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-24 06:15:42 +03:00
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
fix #25924
(cherry picked from commit d032500687
)
This commit is contained in:
parent
27a40aeb6b
commit
d5c4f3430e
1 changed files with 3 additions and 1 deletions
|
@ -75,6 +75,8 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func runEnvironmentToIni(c *cli.Context) error {
|
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{
|
setting.InitWorkPathAndCfgProvider(os.Getenv, setting.ArgWorkPathAndCustomConf{
|
||||||
WorkPath: c.String("work-path"),
|
WorkPath: c.String("work-path"),
|
||||||
CustomPath: c.String("custom-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)
|
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
|
// try to save the config file
|
||||||
destination := c.String("out")
|
destination := c.String("out")
|
||||||
|
|
Loading…
Reference in a new issue