From 56e3dc6b4307e0148fa0d21a305fdfee63aef750 Mon Sep 17 00:00:00 2001 From: Benj Fassbind Date: Tue, 14 Nov 2023 13:03:44 +0100 Subject: [PATCH] fix(shell): network config cache fallback --- src/platform/shell.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/platform/shell.go b/src/platform/shell.go index 15b9e481..98736df7 100644 --- a/src/platform/shell.go +++ b/src/platform/shell.go @@ -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)