diff options
| author | Fuwn <[email protected]> | 2024-10-14 10:43:53 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-14 10:43:53 +0000 |
| commit | 7df9be2d42a5998f0f4151804d936441220366a1 (patch) | |
| tree | 46eb379f92cc7d06bcbbf25f36345079ac47c75d | |
| parent | docs(readme): add section heading for example (diff) | |
| download | yae-7df9be2d42a5998f0f4151804d936441220366a1.tar.xz yae-7df9be2d42a5998f0f4151804d936441220366a1.zip | |
feat(yae): add file not found and init information
| -rw-r--r-- | yae.go | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -30,7 +30,16 @@ func main() { return nil } - return sources.Load(c.String("sources")) + location := c.String("sources") + + if _, err := os.Stat(location); os.IsNotExist(err) { + return fmt.Errorf( + "file `%s` was not present, run `yae init` to create it", + location, + ) + } + + return sources.Load(location) }, Flags: []cli.Flag{ &cli.StringFlag{ |