mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
have dev.sh deps download NERD font automatically
This commit is contained in:
@@ -21,10 +21,12 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
folder = "dependencies"
|
folder = "dependencies"
|
||||||
|
fonts_folder = "fonts"
|
||||||
macos_prefix = "/Users/Shared/kitty-build/sw/sw"
|
macos_prefix = "/Users/Shared/kitty-build/sw/sw"
|
||||||
macos_python = "python/Python.framework/Versions/Current/bin/python3"
|
macos_python = "python/Python.framework/Versions/Current/bin/python3"
|
||||||
macos_python_framework = "python/Python.framework/Versions/Current/Python"
|
macos_python_framework = "python/Python.framework/Versions/Current/Python"
|
||||||
macos_python_framework_exe = "python/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/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 {
|
func root_dir() string {
|
||||||
@@ -35,6 +37,14 @@ func root_dir() string {
|
|||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func fonts_dir() string {
|
||||||
|
f, e := filepath.Abs(fonts_folder)
|
||||||
|
if e != nil {
|
||||||
|
exit(e)
|
||||||
|
}
|
||||||
|
return f
|
||||||
|
}
|
||||||
|
|
||||||
var _ = fmt.Print
|
var _ = fmt.Print
|
||||||
|
|
||||||
func exit(x any) {
|
func exit(x any) {
|
||||||
@@ -325,6 +335,19 @@ func dependencies(args []string) {
|
|||||||
}); err != nil {
|
}); err != nil {
|
||||||
exit(err)
|
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`)
|
fmt.Println(`Dependencies downloaded. Now build kitty with: ./dev.sh build`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user