mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -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)
|
configPath := filepath.Join(env.CachePath(), filename)
|
||||||
cfg, err := env.HTTPRequest(location, nil, 5000)
|
cfg, err := env.HTTPRequest(location, nil, 5000)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if _, osErr := os.Stat(configPath); !os.IsNotExist(osErr) {
|
||||||
|
// use the already cached config
|
||||||
|
env.CmdFlags.Config = configPath
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
out, err := os.Create(configPath)
|
out, err := os.Create(configPath)
|
||||||
|
|
Loading…
Reference in a new issue