mirror of
https://github.com/EnumeratedDev/typer.git
synced 2026-09-16 05:36:10 +00:00
Add config paths for MacOS systems
This commit is contained in:
+7
-2
@@ -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
@@ -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
@@ -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"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user