Commit d1181972 authored by Matthew Holt's avatar Matthew Holt

core: Error if root directory is not found

parent 7ee36533
......@@ -28,6 +28,16 @@ func init() {
return p.argErr()
}
p.cfg.Root = p.tkn()
// Ensure root folder exists
_, err := os.Stat(p.cfg.Root)
if err != nil {
if os.IsNotExist(err) {
return p.err("Path", "Root path "+p.cfg.Root+" does not exist")
} else {
return p.err("Path", "Unable to access root path "+p.cfg.Root)
}
}
return nil
},
"import": func(p *parser) error {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment