fix: build
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user