mirror of
https://github.com/kovidgoyal/kitty.git
synced 2025-12-13 20:36:22 +01:00
have dev.sh deps download NERD font automatically
This commit is contained in:
@@ -21,10 +21,12 @@ import (
|
||||
|
||||
const (
|
||||
folder = "dependencies"
|
||||
fonts_folder = "fonts"
|
||||
macos_prefix = "/Users/Shared/kitty-build/sw/sw"
|
||||
macos_python = "python/Python.framework/Versions/Current/bin/python3"
|
||||
macos_python_framework = "python/Python.framework/Versions/Current/Python"
|
||||
macos_python_framework_exe = "python/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/Python"
|
||||
NERD_URL = "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/NerdFontsSymbolsOnly.tar.xz"
|
||||
)
|
||||
|
||||
func root_dir() string {
|
||||
@@ -35,6 +37,14 @@ func root_dir() string {
|
||||
return f
|
||||
}
|
||||
|
||||
func fonts_dir() string {
|
||||
f, e := filepath.Abs(fonts_folder)
|
||||
if e != nil {
|
||||
exit(e)
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
var _ = fmt.Print
|
||||
|
||||
func exit(x any) {
|
||||
@@ -325,6 +335,19 @@ func dependencies(args []string) {
|
||||
}); err != nil {
|
||||
exit(err)
|
||||
}
|
||||
tarfile, _ = filepath.Abs(cached_download(NERD_URL))
|
||||
root = fonts_dir()
|
||||
if err := os.MkdirAll(root, 0o755); err != nil {
|
||||
exit(err)
|
||||
}
|
||||
cmd = exec.Command("tar", "xf", tarfile, "SymbolsNerdFontMono-Regular.ttf")
|
||||
cmd.Dir = root
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
if err = cmd.Run(); err != nil {
|
||||
exit(err)
|
||||
}
|
||||
|
||||
fmt.Println(`Dependencies downloaded. Now build kitty with: ./dev.sh build`)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user