diff options
| author | Dax Raad <[email protected]> | 2025-05-17 21:31:42 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-05-26 12:40:17 -0400 |
| commit | a34d020bc6b252e842f042d935c7a0e6444460cf (patch) | |
| tree | ea3484499dff80e82d421e879ab639133ae9c3b4 /pkg/global | |
| parent | 96fbc37f0175052291f8a096d530bd4480f6cb19 (diff) | |
| download | opencode-a34d020bc6b252e842f042d935c7a0e6444460cf.tar.gz opencode-a34d020bc6b252e842f042d935c7a0e6444460cf.zip | |
sync
Diffstat (limited to 'pkg/global')
| -rw-r--r-- | pkg/global/global.go | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/pkg/global/global.go b/pkg/global/global.go new file mode 100644 index 000000000..be08eda2b --- /dev/null +++ b/pkg/global/global.go @@ -0,0 +1,38 @@ +package global + +import ( + "os" + "path/filepath" +) + +var configDir = (func() string { + home, err := os.UserConfigDir() + if err != nil { + panic(err) + } + result := filepath.Join(home, "sst") + os.MkdirAll(result, 0755) + os.MkdirAll(filepath.Join(result, "bin"), 0755) + return result +}()) + +var cacheDir = (func() string { + home, err := os.UserCacheDir() + if err != nil { + panic(err) + } + result := filepath.Join(home, "sst") + os.MkdirAll(result, 0755) + return result +}()) + +func ConfigDir() string { + return configDir +} + +func CacheDir() string { + return cacheDir +} + +type Config struct { +} |
