mirror of
https://github.com/caddyserver/caddy.git
synced 2025-04-23 05:07:50 +08:00
core: Error if root directory is not found
This commit is contained in:
parent
7ee3653342
commit
d11819721d
@ -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…
x
Reference in New Issue
Block a user