This commit is contained in:
Dax Raad
2025-05-17 21:31:42 -04:00
parent 96fbc37f01
commit a34d020bc6
26 changed files with 979 additions and 54 deletions

38
pkg/global/global.go Normal file
View File

@@ -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 {
}