fix: validate path

See https://git.vvvvvvaria.org/decentral1se/distribusi-go/issues/13.
This commit is contained in:
decentral1se 2022-03-06 00:22:40 +01:00
parent 7338a70ebc
commit 66e8a201ed
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410

View File

@ -267,6 +267,7 @@ Example:
return nil
},
Action: func(c *cli.Context) error {
if c.Bool("serve") && c.String("publish") != "" {
logrus.Fatal("woops, can't publish & serve at the same time?")
}
@ -276,6 +277,10 @@ Example:
logrus.Fatal(err)
}
if _, err := os.Stat(root); os.IsNotExist(err) {
logrus.Fatalf("%s does not exist?", root)
}
logrus.Debugf("selecting %s as distribusi root", root)
var ignore []string