Add config paths for MacOS systems

This commit is contained in:
2026-04-27 20:07:48 +03:00
parent a1e8d6c19a
commit b564e0ec2e
3 changed files with 22 additions and 7 deletions
+7 -2
View File
@@ -43,10 +43,15 @@ func readConfig() {
}
configPaths := make([]string, 0)
if runtime.GOOS == "windows" {
switch runtime.GOOS {
case "windows":
configPaths = append(configPaths, filepath.Join(homeDir, "AppData/Roaming/Typer/config.yml"))
configPaths = append(configPaths, filepath.Join(filepath.Dir(execPath), "etc/typer/config.yml"))
} else {
case "darwin":
configPaths = append(configPaths, filepath.Join(homeDir, "Library/Typer/config.yml"))
configPaths = append(configPaths, "/Library/Typer/config.yml")
configPaths = append(configPaths, filepath.Join(sysconfdir, "typer/config.yml"))
default:
configPaths = append(configPaths, filepath.Join(homeDir, ".config/typer/config.yml"))
configPaths = append(configPaths, filepath.Join(sysconfdir, "typer/config.yml"))
}
+7 -2
View File
@@ -39,10 +39,15 @@ func readKeybindings() {
}
configPaths := make([]string, 0)
if runtime.GOOS == "windows" {
switch runtime.GOOS {
case "windows":
configPaths = append(configPaths, filepath.Join(homeDir, "AppData/Roaming/Typer/keybindings.yml"))
configPaths = append(configPaths, filepath.Join(filepath.Dir(execPath), "etc/typer/keybindings.yml"))
} else {
case "darwin":
configPaths = append(configPaths, filepath.Join(homeDir, "Library/Typer/keybindings.yml"))
configPaths = append(configPaths, "/Library/Typer/keybindings.yml")
configPaths = append(configPaths, filepath.Join(sysconfdir, "typer/keybindings.yml"))
default:
configPaths = append(configPaths, filepath.Join(homeDir, ".config/typer/keybindings.yml"))
configPaths = append(configPaths, filepath.Join(sysconfdir, "typer/keybindings.yml"))
}
+8 -3
View File
@@ -84,10 +84,15 @@ func readStyles() {
}
stylesPaths := make([]string, 0)
if runtime.GOOS == "windows" {
switch runtime.GOOS {
case "windows":
stylesPaths = append(stylesPaths, filepath.Join(homeDir, "AppData/Roaming/Typer/styles"))
stylesPaths = append(stylesPaths, filepath.Join(filepath.Dir(execPath), "etc/typer/styles"))
} else {
stylesPaths = append(stylesPaths, filepath.Join(filepath.Dir(execPath), "config/styles"))
case "darwin":
stylesPaths = append(stylesPaths, filepath.Join(homeDir, "Library/Typer/styles"))
stylesPaths = append(stylesPaths, "/Library/Typer/styles")
stylesPaths = append(stylesPaths, filepath.Join(sysconfdir, "typer/styles"))
default:
stylesPaths = append(stylesPaths, filepath.Join(homeDir, ".config/typer/styles"))
stylesPaths = append(stylesPaths, filepath.Join(sysconfdir, "typer/styles"))
}