fix: create skins directory on startup
All checks were successful
CI / lint (push) Successful in 59s
CI / test (push) Successful in 29s
CI / build (push) Successful in 19s
CI / docker (push) Successful in 1m16s

This commit is contained in:
2026-06-05 16:37:13 +03:00
parent 74ad023a36
commit d419d59fe3

View File

@@ -4,6 +4,7 @@ package config
import ( import (
"fmt" "fmt"
"os" "os"
"path/filepath"
"strconv" "strconv"
) )
@@ -51,6 +52,14 @@ func Load() (*Config, error) {
return nil, fmt.Errorf("JWT_SECRET is required") return nil, fmt.Errorf("JWT_SECRET is required")
} }
// Create storage directories if they don't exist.
if err := os.MkdirAll(cfg.CASDir, 0o755); err != nil {
return nil, fmt.Errorf("failed to create CAS directory: %w", err)
}
if err := os.MkdirAll(filepath.Join(cfg.SkinsDir, "aa"), 0o755); err != nil { // Create with subdirectory structure
return nil, fmt.Errorf("failed to create skins directory: %w", err)
}
return cfg, nil return cfg, nil
} }