fix(shell): network config cache fallback

This commit is contained in:
Benj Fassbind 2023-11-14 13:03:44 +01:00 committed by Jan De Dobbeleer
parent 2b377b18c2
commit 56e3dc6b43

View file

@ -351,6 +351,12 @@ func (env *Shell) downloadConfig(location string) error {
configPath := filepath.Join(env.CachePath(), filename)
cfg, err := env.HTTPRequest(location, nil, 5000)
if err != nil {
if _, osErr := os.Stat(configPath); !os.IsNotExist(osErr) {
// use the already cached config
env.CmdFlags.Config = configPath
return nil
}
return err
}
out, err := os.Create(configPath)