mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-26 02:21:25 -08:00
refactor: do not write empty cache list
This commit is contained in:
parent
a118e178b5
commit
1cff56a709
|
@ -40,7 +40,11 @@ func (fc *fileCache) init(cachePath string) {
|
|||
}
|
||||
|
||||
func (fc *fileCache) close() {
|
||||
if dump, err := json.MarshalIndent(fc.cache.list(), "", " "); err == nil {
|
||||
cache := fc.cache.list()
|
||||
if len(cache) == 0 {
|
||||
return
|
||||
}
|
||||
if dump, err := json.MarshalIndent(cache, "", " "); err == nil {
|
||||
_ = ioutil.WriteFile(fc.cachePath+fileName, dump, 0644)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue