mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
parent
289c32adbf
commit
c1bdd735be
|
@ -15,7 +15,7 @@ import (
|
||||||
"github.com/gookit/config/v2"
|
"github.com/gookit/config/v2"
|
||||||
"github.com/gookit/config/v2/json"
|
"github.com/gookit/config/v2/json"
|
||||||
"github.com/gookit/config/v2/toml"
|
"github.com/gookit/config/v2/toml"
|
||||||
"github.com/gookit/config/v2/yaml"
|
yaml "github.com/gookit/config/v2/yamlv3"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -181,13 +181,11 @@ func (cfg *Config) Export(format string) string {
|
||||||
|
|
||||||
_, err := config.DumpTo(&result, cfg.format)
|
_, err := config.DumpTo(&result, cfg.format)
|
||||||
cfg.exitWithError(err)
|
cfg.exitWithError(err)
|
||||||
var prefix string
|
if cfg.format == YAML {
|
||||||
switch cfg.format {
|
prefix := "# yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json\n\n"
|
||||||
case YAML:
|
return prefix + result.String()
|
||||||
prefix = "# yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json\n\n"
|
|
||||||
case TOML:
|
|
||||||
prefix = "#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json\n\n"
|
|
||||||
}
|
}
|
||||||
|
prefix := "#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json\n\n"
|
||||||
return prefix + escapeGlyphs(result.String())
|
return prefix + escapeGlyphs(result.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@ require (
|
||||||
github.com/tklauser/numcpus v0.4.0 // indirect
|
github.com/tklauser/numcpus v0.4.0 // indirect
|
||||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
|
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|
Loading…
Reference in a new issue