diff options
| author | Fuwn <[email protected]> | 2024-10-14 03:43:53 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-14 03:43:53 -0700 |
| commit | 5f335b4c66cd2045557cb18d62245dfe4ced1708 (patch) | |
| tree | 46eb379f92cc7d06bcbbf25f36345079ac47c75d /yae.go | |
| parent | f5ea04daeece2c6beceb0dbcad7a4357bf43bcd1 (diff) | |
| download | yae-5f335b4c66cd2045557cb18d62245dfe4ced1708.tar.xz yae-5f335b4c66cd2045557cb18d62245dfe4ced1708.zip | |
feat(yae): add file not found and init information
Diffstat (limited to 'yae.go')
| -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{ |