From 5f335b4c66cd2045557cb18d62245dfe4ced1708 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 14 Oct 2024 03:43:53 -0700 Subject: feat(yae): add file not found and init information --- yae.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/yae.go b/yae.go index 30c1733..d943555 100644 --- a/yae.go +++ b/yae.go @@ -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{ -- cgit v1.2.3