feat: add group

This commit is contained in:
2024-11-16 23:50:34 +07:00
parent b88b04a235
commit c8e61ed4aa
24 changed files with 534 additions and 86 deletions
+8 -6
View File
@@ -9,16 +9,18 @@ import (
)
func GetDataPath(resolveFile string) string {
dataDir := os.Getenv("DATA_DIR")
if dataDir != "" {
return filepath.Join(dataDir, resolveFile)
}
// Resolve the app directory
execPath, err := os.Executable()
cwd, err := os.Getwd()
if err != nil {
return ""
}
appDir := filepath.Dir(execPath)
if resolveFile == "" {
return appDir
}
return filepath.Join(appDir, resolveFile)
return filepath.Join(cwd, resolveFile)
}
func CheckAndCreateEnvFile() error {