fix: build

This commit is contained in:
2026-04-28 22:09:19 -04:00
parent fcfa43cca3
commit 4c1523d81b
9 changed files with 60 additions and 20 deletions

View File

@@ -13,6 +13,7 @@ type cliParams struct {
ListenAddr string
ListenPort int
DataDir string
StaticDir string
SettingsFile string
}
@@ -41,5 +42,16 @@ func (p *cliParams) Validate() error {
return fmt.Errorf("failed to create images directory: %w", err)
}
// Validate Static Directory
if p.StaticDir != "" {
info, err := os.Stat(p.StaticDir)
if err != nil {
return fmt.Errorf("failed to access static directory: %w", err)
}
if !info.IsDir() {
return fmt.Errorf("static directory is not a directory: %s", p.StaticDir)
}
}
return nil
}