aboutsummaryrefslogtreecommitdiff
path: root/yae.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-14 03:43:53 -0700
committerFuwn <[email protected]>2024-10-14 03:43:53 -0700
commit5f335b4c66cd2045557cb18d62245dfe4ced1708 (patch)
tree46eb379f92cc7d06bcbbf25f36345079ac47c75d /yae.go
parentf5ea04daeece2c6beceb0dbcad7a4357bf43bcd1 (diff)
downloadyae-5f335b4c66cd2045557cb18d62245dfe4ced1708.tar.xz
yae-5f335b4c66cd2045557cb18d62245dfe4ced1708.zip
feat(yae): add file not found and init information
Diffstat (limited to 'yae.go')
-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{