mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
feat(font): reload font cache on unix systems
This commit is contained in:
parent
89beb8db68
commit
ddd120178d
|
@ -7,7 +7,11 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io"
|
"io"
|
||||||
"path"
|
"path"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"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 {
|
func contains[S ~[]E, E comparable](s S, e E) bool {
|
||||||
|
@ -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
|
return families, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue