mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
core: Error if root directory is not found
This commit is contained in:
parent
7ee3653342
commit
d11819721d
1 changed files with 10 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue