mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-31 22:32:45 +00:00
Dont use a global var for mocking
This commit is contained in:
parent
86a6685446
commit
795bf7fb52
3 changed files with 8 additions and 8 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue