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