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:
2
Makefile
2
Makefile
@@ -6,7 +6,7 @@ BINDIR ?= ${PREFIX}/bin
|
|||||||
MANDIR ?= ${PREFIX}/man
|
MANDIR ?= ${PREFIX}/man
|
||||||
DATE ?= `date -u +%F`
|
DATE ?= `date -u +%F`
|
||||||
GOOS ?= `${GO} env GOOS`
|
GOOS ?= `${GO} env GOOS`
|
||||||
VERSION ?= 1.0G+${REV}
|
VERSION ?= 1.0H+${REV}
|
||||||
REV ?= `svn info --show-item revision || git rev-list --all | wc -l`
|
REV ?= `svn info --show-item revision || git rev-list --all | wc -l`
|
||||||
build:
|
build:
|
||||||
${GO} build ${GOFLAGS} ./cmd/aya
|
${GO} build ${GOFLAGS} ./cmd/aya
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ func buildAll(watch bool) {
|
|||||||
run(vars, "prehook")
|
run(vars, "prehook")
|
||||||
modified = true
|
modified = true
|
||||||
}
|
}
|
||||||
fmt.Println("GEN", path)
|
fmt.Println(path)
|
||||||
return build(path, nil, vars)
|
return build(path, nil, vars)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -50,7 +50,12 @@ func main() {
|
|||||||
case "help":
|
case "help":
|
||||||
aya.PrintUsage()
|
aya.PrintUsage()
|
||||||
case "serve":
|
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":
|
case "var":
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
log.Fatal("[var] Filename expected")
|
log.Fatal("[var] Filename expected")
|
||||||
|
|||||||
Reference in New Issue
Block a user