mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-26 19:39:39 -08:00
fix(shell): network config cache fallback
This commit is contained in:
parent
2b377b18c2
commit
56e3dc6b43
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue