aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-14 10:43:53 +0000
committerFuwn <[email protected]>2024-10-14 10:43:53 +0000
commit7df9be2d42a5998f0f4151804d936441220366a1 (patch)
tree46eb379f92cc7d06bcbbf25f36345079ac47c75d
parentdocs(readme): add section heading for example (diff)
downloadyae-7df9be2d42a5998f0f4151804d936441220366a1.tar.xz
yae-7df9be2d42a5998f0f4151804d936441220366a1.zip
feat(yae): add file not found and init information
-rw-r--r--yae.go11
1 files changed, 10 insertions, 1 deletions
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{