mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-14 13:24:49 +02:00
35 lines
529 B
Go
35 lines
529 B
Go
package icons
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/samber/lo"
|
|
)
|
|
|
|
type IconProperties struct {
|
|
Icon string
|
|
Color string
|
|
}
|
|
|
|
var isIconEnabled = false
|
|
|
|
func IsIconEnabled() bool {
|
|
return isIconEnabled
|
|
}
|
|
|
|
func SetNerdFontsVersion(version string) {
|
|
if version == "" {
|
|
isIconEnabled = false
|
|
} else {
|
|
if !lo.Contains([]string{"2", "3"}, version) {
|
|
log.Fatalf("Unsupported nerdFontVersion %s", version)
|
|
}
|
|
|
|
if version == "2" {
|
|
patchGitIconsForNerdFontsV2()
|
|
patchFileIconsForNerdFontsV2()
|
|
}
|
|
|
|
isIconEnabled = true
|
|
}
|
|
}
|