Merge branch 'master' into travis/server-name-join

This commit is contained in:
Travis Ralston 2018-07-05 11:23:13 -06:00 committed by GitHub
commit 4485b2f025
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 91 additions and 34 deletions

View file

@ -98,8 +98,10 @@ func makeWalker(base string, w *fsnotify.Watcher) filepath.WalkFunc {
log.Fatalf("Failed to get relative path of %s: %v", path, err)
}
// Normalize slashes
rel = filepath.ToSlash(rel)
// skip a few things that we know don't form part of the spec
rel = strings.Replace(rel, "\\", "/", -1) // normalize slashes (thanks to windows)
if rel == "api/node_modules" ||
rel == "scripts/gen" ||
rel == "scripts/tmp" {
@ -127,7 +129,7 @@ func filter(e fsnotify.Event) bool {
}
// Forcefully ignore directories we don't care about (Windows, at least, tries to notify about some directories)
filePath := strings.Replace(e.Name, "\\", "/", -1) // normalize slashes (thanks to windows)
filePath := filepath.ToSlash(e.Name) // normalize slashes
if strings.Contains(filePath, "/scripts/tmp") ||
strings.Contains(filePath, "/scripts/gen") ||
strings.Contains(filePath, "/api/node_modules") {
@ -156,11 +158,7 @@ func serve(w http.ResponseWriter, req *http.Request) {
if file[0] == '/' {
file = file[1:]
}
b, ok = m.bytes[file]
if !ok {
b, ok = m.bytes[strings.Replace(file, "/", "\\", -1)] // Attempt a Windows lookup
}
b, ok = m.bytes[filepath.FromSlash(file)] // de-normalize slashes
if ok && file == "api-docs.json" {
w.Header().Set("Access-Control-Allow-Origin", "*")

View file

@ -8,8 +8,11 @@ cd `dirname $0`/..
mkdir -p assets
# generate specification/proposals.rst
./scripts/proposals.py
if [ "$TRAVIS" != "true" ]
then
# generate specification/proposals.rst
./scripts/proposals.py
fi
# generate the spec docs
./scripts/gendoc.py -d assets/spec

View file

@ -713,6 +713,8 @@ func main() {
"ara4n": true,
"leonerd": true,
"rxl881": true,
"uhoreg": true,
"turt2live": true,
}
if err := initCache(); err != nil {
log.Fatal(err)