validate presets

This commit is contained in:
filifa 2024-09-03 22:38:13 -05:00
parent e0c4715cd5
commit a53928ef5e
1 changed files with 8 additions and 0 deletions

View File

@ -104,6 +104,14 @@ func milkbucket(cmd *cobra.Command, args []string) {
defer sdl.Quit() defer sdl.Quit()
presets := getPresets() presets := getPresets()
for _, p := range presets {
info, err := os.Stat(p)
if err != nil {
panic(err)
} else if info.IsDir() {
panic("preset " + p + " is a directory")
}
}
m, err := newMilkDropWindow(800, 600, presets) m, err := newMilkDropWindow(800, 600, presets)
if err != nil { if err != nil {