From a78613b63b6a5aeeee351be8d8c9010bd9e6b0aa Mon Sep 17 00:00:00 2001 From: Azareal Date: Mon, 14 May 2018 20:21:18 +1000 Subject: [PATCH] Does Git recognise this folder now...? --- client/main.go | 2 +- common/files.go | 8 ++++---- common/template_init.go | 2 +- tmpl_client/filler.txt | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 tmpl_client/filler.txt diff --git a/client/main.go b/client/main.go index b1458716..29a2439e 100644 --- a/client/main.go +++ b/client/main.go @@ -5,7 +5,7 @@ import ( "../common" "../common/alerts" - "../tmpl_gen" + "../tmpl_client" "github.com/gopherjs/gopherjs/js" ) diff --git a/common/files.go b/common/files.go index e2d3500a..aa06e7d0 100644 --- a/common/files.go +++ b/common/files.go @@ -14,7 +14,7 @@ import ( "os" "path/filepath" - "../tmpl_gen" + "../tmpl_client" ) type SFileList map[string]SFile @@ -41,7 +41,7 @@ func (list SFileList) JSTmplInit() error { var fragMap = make(map[string][][]byte) fragMap["alert"] = tmpl.Get_alert_frags() // TODO: Add a generic fetch function, so we don't rely on the presence of the template files for this fmt.Println("fragMap: ", fragMap) - return filepath.Walk("./tmpl_gen", func(path string, f os.FileInfo, err error) error { + return filepath.Walk("./tmpl_client", func(path string, f os.FileInfo, err error) error { if f.IsDir() { return nil } @@ -157,7 +157,7 @@ func (list SFileList) JSTmplInit() error { data = replace(data, "};", "}") data = replace(data, ";;", ";") - path = strings.TrimPrefix(path, "tmpl_gen/") + path = strings.TrimPrefix(path, "tmpl_client/") tmplName := strings.TrimSuffix(path, ".go") fragset, ok := fragMap[strings.TrimPrefix(tmplName, "template_")] if !ok { @@ -174,7 +174,7 @@ func (list SFileList) JSTmplInit() error { path = tmplName + ".js" DebugLog("js path: ", path) - var ext = filepath.Ext("/tmpl_gen/" + path) + var ext = filepath.Ext("/tmpl_client/" + path) gzipData := compressBytesGzip(data) list.Set("/static/"+path, SFile{data, gzipData, 0, int64(len(data)), int64(len(gzipData)), mime.TypeByExtension(ext), f, f.ModTime().UTC().Format(http.TimeFormat)}) diff --git a/common/template_init.go b/common/template_init.go index 4f28262a..2aafb4d3 100644 --- a/common/template_init.go +++ b/common/template_init.go @@ -316,7 +316,7 @@ func CompileJSTemplates() error { return err } - var dirPrefix = "./tmpl_gen/" + var dirPrefix = "./tmpl_client/" var wg sync.WaitGroup var writeTemplate = func(name string, content string) { log.Print("Writing template '" + name + "'") diff --git a/tmpl_client/filler.txt b/tmpl_client/filler.txt new file mode 100644 index 00000000..20e14b1e --- /dev/null +++ b/tmpl_client/filler.txt @@ -0,0 +1 @@ +This file is here so that Git will include this folder in the repository. \ No newline at end of file