validate presets
This commit is contained in:
parent
e0c4715cd5
commit
a53928ef5e
|
@ -104,6 +104,14 @@ func milkbucket(cmd *cobra.Command, args []string) {
|
|||
defer sdl.Quit()
|
||||
|
||||
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)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue