mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-25 19:14:50 -08:00
fix(fonts): only install tff for CascadiaCode
This commit is contained in:
parent
3b40f825c3
commit
b4a51815f9
|
@ -43,7 +43,7 @@ func Fonts() ([]*Asset, error) {
|
||||||
|
|
||||||
cascadiaCode, err := CascadiaCode()
|
cascadiaCode, err := CascadiaCode()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
assets = append(assets, cascadiaCode...)
|
assets = append(assets, cascadiaCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
sort.Slice(assets, func(i, j int) bool { return assets[i].Name < assets[j].Name })
|
sort.Slice(assets, func(i, j int) bool { return assets[i].Name < assets[j].Name })
|
||||||
|
@ -85,38 +85,16 @@ func setCachedFontData(assets []*Asset) {
|
||||||
cache.Set(cache_.FONTLISTCACHE, string(data), cache_.ONEDAY)
|
cache.Set(cache_.FONTLISTCACHE, string(data), cache_.ONEDAY)
|
||||||
}
|
}
|
||||||
|
|
||||||
func CascadiaCode() ([]*Asset, error) {
|
func CascadiaCode() (*Asset, error) {
|
||||||
assets, err := fetchFontAssets("microsoft/cascadia-code")
|
assets, err := fetchFontAssets("microsoft/cascadia-code")
|
||||||
if err != nil || len(assets) != 1 {
|
if err != nil || len(assets) != 1 {
|
||||||
return nil, errors.New("no assets found")
|
return nil, errors.New("no assets found")
|
||||||
}
|
}
|
||||||
|
|
||||||
return []*Asset{
|
return &Asset{
|
||||||
{
|
Name: CascadiaCodeMS,
|
||||||
Name: fmt.Sprintf("%s - TTF", CascadiaCodeMS),
|
|
||||||
URL: assets[0].URL,
|
URL: assets[0].URL,
|
||||||
Folder: "ttf/",
|
Folder: "ttf/",
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: fmt.Sprintf("%s - TTF Static", CascadiaCodeMS),
|
|
||||||
URL: assets[0].URL,
|
|
||||||
Folder: "ttf/static/",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: fmt.Sprintf("%s - OTF Static", CascadiaCodeMS),
|
|
||||||
URL: assets[0].URL,
|
|
||||||
Folder: "otf/static/",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: fmt.Sprintf("%s - WOFF2", CascadiaCodeMS),
|
|
||||||
URL: assets[0].URL,
|
|
||||||
Folder: "woff2/static/",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: fmt.Sprintf("%s - WOFF2 Static", CascadiaCodeMS),
|
|
||||||
URL: assets[0].URL,
|
|
||||||
Folder: "woff2/static/",
|
|
||||||
},
|
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue