aboutsummaryrefslogtreecommitdiff
path: root/src/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.go')
-rw-r--r--src/config.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/config.go b/src/config.go
index 8f931ae..c8eae28 100644
--- a/src/config.go
+++ b/src/config.go
@@ -70,6 +70,16 @@ func getConfigFilePath() (string, error) {
70 os.MkdirAll(path, os.ModeDir.Perm()) 70 os.MkdirAll(path, os.ModeDir.Perm())
71 71
72 path = filepath.Join(path, "termsonic.toml") 72 path = filepath.Join(path, "termsonic.toml")
73 } else if runtime.GOOS == "darwin" {
74 home := os.Getenv("HOME")
75 if home == "" {
76 return "", fmt.Errorf("could not get home directory")
77 }
78
79 path = filepath.Join(home, "Library", "Application Support", "Termsonic")
80 os.MkdirAll(path, os.ModeDir.Perm() | 0700)
81
82 path = filepath.Join(path, "termsonic.toml")
73 } else { 83 } else {
74 return "", fmt.Errorf("unsupported operating system: %s", runtime.GOOS) 84 return "", fmt.Errorf("unsupported operating system: %s", runtime.GOOS)
75 } 85 }