Port custom processor for hints

This commit is contained in:
Kovid Goyal
2023-03-10 10:45:37 +05:30
parent 69916ca4e8
commit b76b0c61ed
7 changed files with 160 additions and 31 deletions

View File

@@ -65,9 +65,12 @@ func Abspath(path string) string {
var KittyExe = (&Once[string]{Run: func() string {
exe, err := os.Executable()
if err == nil {
return filepath.Join(filepath.Dir(exe), "kitty")
ans := filepath.Join(filepath.Dir(exe), "kitty")
if s, err := os.Stat(ans); err == nil && !s.IsDir() {
return ans
}
}
return ""
return os.Getenv("KITTY_PATH_TO_KITTY_EXE")
}}).Get
var ConfigDir = (&Once[string]{Run: func() (config_dir string) {