Commit 782ba324 authored by Matthew Holt's avatar Matthew Holt

Only a warning if site root doesn't exist

parent d1181972
package config
import (
"fmt"
"log"
"os"
"os/exec"
......@@ -30,12 +32,14 @@ func init() {
p.cfg.Root = p.tkn()
// Ensure root folder exists
_, err := os.Stat(p.cfg.Root)
_, err := os.Open(p.cfg.Root)
if err != nil {
if os.IsNotExist(err) {
return p.err("Path", "Root path "+p.cfg.Root+" does not exist")
// Allow this, because the folder might appear later.
// But make sure the user knows!
log.Printf("Warning: Root path %s does not exist", p.cfg.Root)
} else {
return p.err("Path", "Unable to access root path "+p.cfg.Root)
return p.err("Path", fmt.Sprintf("Unable to access root path '%s': %s", p.cfg.Root, err.Error()))
}
}
return nil
......
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