mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-26 19:39:39 -08:00
parent
8e1902b4de
commit
64196fe6ad
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
|
@ -11,7 +11,7 @@
|
||||||
"prompt",
|
"prompt",
|
||||||
"print",
|
"print",
|
||||||
"primary",
|
"primary",
|
||||||
"--config=${workspaceRoot}/themes/cinnamon.omp.json",
|
"--config=https://gist.githubusercontent.com/ehawman-rosenberg/50b3b695526f03690cfd396d02c2cca3/raw/c2e0bc78cdf551b0cc76f593e4fd70428f981c0e/eh-tea.omp.json",
|
||||||
"--shell=pwsh",
|
"--shell=pwsh",
|
||||||
"--terminal-width=200",
|
"--terminal-width=200",
|
||||||
]
|
]
|
||||||
|
|
|
@ -257,26 +257,7 @@ func (env *ShellEnvironment) resolveConfigPath() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (env *ShellEnvironment) downloadConfig(location string) error {
|
func (env *ShellEnvironment) downloadConfig(location string) error {
|
||||||
configFileName := fmt.Sprintf("%s.omp.json", env.Version)
|
configPath := filepath.Join(env.CachePath(), "config.omp.json")
|
||||||
configPath := filepath.Join(env.CachePath(), configFileName)
|
|
||||||
if env.HasFilesInDir(env.CachePath(), configFileName) {
|
|
||||||
env.CmdFlags.Config = configPath
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
// clean old config files
|
|
||||||
cleanCacheDir := func() {
|
|
||||||
dir, err := ioutil.ReadDir(env.CachePath())
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for _, file := range dir {
|
|
||||||
if strings.HasSuffix(file.Name(), ".omp.json") {
|
|
||||||
os.Remove(filepath.Join(env.CachePath(), file.Name()))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cleanCacheDir()
|
|
||||||
|
|
||||||
cfg, err := env.HTTPRequest(location, 5000)
|
cfg, err := env.HTTPRequest(location, 5000)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue