mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 04:19:41 -08:00
fix: store downloaded config on file name hash
This commit is contained in:
parent
fc50dd4da8
commit
b5bde55cf2
|
@ -3,6 +3,7 @@ package platform
|
|||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
@ -345,7 +346,9 @@ func (env *Shell) resolveConfigPath() {
|
|||
func (env *Shell) downloadConfig(location string) error {
|
||||
defer env.Trace(time.Now(), location)
|
||||
ext := filepath.Ext(location)
|
||||
configPath := filepath.Join(env.CachePath(), "config.omp"+ext)
|
||||
fileHash := base64.StdEncoding.EncodeToString([]byte(location))
|
||||
filename := fmt.Sprintf("config.%s.omp%s", fileHash, ext)
|
||||
configPath := filepath.Join(env.CachePath(), filename)
|
||||
cfg, err := env.HTTPRequest(location, nil, 5000)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue