Forbid the serve command to work on a non-existent directory
git-svn-id: file:///srv/svn/repo/aya/trunk@92 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
@@ -38,7 +38,7 @@ func buildAll(watch bool) {
|
||||
run(vars, "prehook")
|
||||
modified = true
|
||||
}
|
||||
fmt.Println("GEN", path)
|
||||
fmt.Println(path)
|
||||
return build(path, nil, vars)
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -50,7 +50,12 @@ func main() {
|
||||
case "help":
|
||||
aya.PrintUsage()
|
||||
case "serve":
|
||||
aya.HttpServe(PUBDIR, 8000)
|
||||
d, err := os.Stat(PUBDIR)
|
||||
if err != nil {
|
||||
log.Fatal("[aya.HttpServe] I see, you want me to serve a non-existent directory, huh?")
|
||||
} else {
|
||||
aya.HttpServe(fmt.Sprint(d), 8000)
|
||||
}
|
||||
case "var":
|
||||
if len(args) == 0 {
|
||||
log.Fatal("[var] Filename expected")
|
||||
|
||||
Reference in New Issue
Block a user