Skip to content

Commit

Permalink
feat(font): reload font cache on unix systems
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Jun 10, 2024
1 parent 89beb8d commit ddd1201
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/font/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import (
"bytes"
"io"
"path"
"runtime"
"strings"

"github.com/jandedobbeleer/oh-my-posh/src/platform"
"github.com/jandedobbeleer/oh-my-posh/src/platform/cmd"
)

func contains[S ~[]E, E comparable](s S, e E) bool {
Expand Down Expand Up @@ -69,5 +73,10 @@ func InstallZIP(data []byte, user bool) ([]string, error) {
}
}

// Update the font cache when installing fonts on Linux
if runtime.GOOS == platform.LINUX || runtime.GOOS == platform.DARWIN {
_, _ = cmd.Run("fc-cache", "-f")
}

return families, nil
}

0 comments on commit ddd1201

Please sign in to comment.