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"))
}