fix: error in creating default configuration

This commit is contained in:
2024-11-09 05:34:23 +01:00
parent c6d1e0e6be
commit 7de898962d
3 changed files with 18 additions and 9 deletions

View File

@@ -24,6 +24,16 @@ func FileExists(filename string) bool {
}
return !info.IsDir()
}
// FolderExists checks if the folder does exist
func FolderExists(name string) bool {
info, err := os.Stat(name)
if os.IsNotExist(err) {
return false
}
return info.IsDir()
}
func GetStringEnv(key, defaultValue string) string {
val := os.Getenv(key)
if val == "" {