Add output directory configuration contract

This commit is contained in:
2026-08-02 01:34:04 +00:00
parent 114f7f5f85
commit 0c4c575eea
4 changed files with 129 additions and 0 deletions

View File

@@ -15,6 +15,9 @@ func Validate(cfg Config) error {
if err := validateReportDistributorPathOverrides(cfg); err != nil {
return err
}
if cfg.Output.Directory != "" && strings.TrimSpace(cfg.Output.Directory) == "" {
return fmt.Errorf("output.directory must not be blank when configured")
}
if cfg.WeatherAPI.BaseURL != "" {
parsed, err := url.Parse(cfg.WeatherAPI.BaseURL)
if err != nil || parsed.Scheme == "" || parsed.Host == "" {