cmd: Fix paths when using an env file (#4296)

* core: Fix paths when using an env file

* refactor: move path logic to loadFromEnv
This commit is contained in:
Pascal Zarrad authored and GitHub committed 2021-08-20 15:51:31 -06:00
1 parent e0a6a1efff
commit ce5a45db45
1 file changed
+5
+5
View File
@@ -361,6 +361,11 @@ func loadEnvFromFile(envFile string) error {
}
}
// Update the storage paths to ensure they have the proper
// value after loading a specified env file.
caddy.ConfigAutosavePath = filepath.Join(caddy.AppConfigDir(), "autosave.json")
caddy.DefaultStorage = &certmagic.FileStorage{Path: caddy.AppDataDir()}
return nil
}