mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -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 (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -345,7 +346,9 @@ func (env *Shell) resolveConfigPath() {
|
||||||
func (env *Shell) downloadConfig(location string) error {
|
func (env *Shell) downloadConfig(location string) error {
|
||||||
defer env.Trace(time.Now(), location)
|
defer env.Trace(time.Now(), location)
|
||||||
ext := filepath.Ext(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)
|
cfg, err := env.HTTPRequest(location, nil, 5000)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue