🐛 Make sure data directory exists on first run

This commit is contained in:
2025-01-06 09:49:40 +01:00
parent 005c509197
commit 6a5eb039f5

View File

@ -38,6 +38,9 @@ func createDefaultConfig(name string) {
dest_path := fmt.Sprintf("%s/%s.toml", CONFIG_DIR, name)
source_path := fmt.Sprintf("sample_configs/%s.toml", name)
if _, err := os.Stat(CONFIG_DIR); errors.Is(err, os.ErrNotExist) {
os.MkdirAll(CONFIG_DIR, 0744)
}
if _, err := os.Stat(dest_path); errors.Is(err, os.ErrNotExist) {
content, err := sampleConfig.ReadFile(source_path)
if err != nil {