mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-09 05:35:19 +02:00
Dont use a global var for mocking
This commit is contained in:
@@ -403,9 +403,12 @@ func ReloadConfigInKitty(in_parent_only bool) error {
|
||||
|
||||
var OverrideEffectiveConfigPath string
|
||||
|
||||
func ReadKittyConfig(line_handler func(key, val string) error) error {
|
||||
func ReadKittyConfig(line_handler func(key, val string) error, override_effective_config_path ...string) error {
|
||||
kp := os.Getenv("KITTY_PID")
|
||||
kitty_conf_path := OverrideEffectiveConfigPath
|
||||
kitty_conf_path := ""
|
||||
if len(override_effective_config_path) > 0 {
|
||||
kitty_conf_path = override_effective_config_path[0]
|
||||
}
|
||||
if _, err := strconv.Atoi(kp); err == nil && kitty_conf_path == "" {
|
||||
effective_config_path := filepath.Join(utils.CacheDir(), "effective-config", kp)
|
||||
if unix.Access(effective_config_path, unix.R_OK) == nil {
|
||||
|
||||
Reference in New Issue
Block a user