Does Git recognise this folder now...?
This commit is contained in:
parent
9075798128
commit
a78613b63b
@ -5,7 +5,7 @@ import (
|
|||||||
|
|
||||||
"../common"
|
"../common"
|
||||||
"../common/alerts"
|
"../common/alerts"
|
||||||
"../tmpl_gen"
|
"../tmpl_client"
|
||||||
"github.com/gopherjs/gopherjs/js"
|
"github.com/gopherjs/gopherjs/js"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"../tmpl_gen"
|
"../tmpl_client"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SFileList map[string]SFile
|
type SFileList map[string]SFile
|
||||||
@ -41,7 +41,7 @@ func (list SFileList) JSTmplInit() error {
|
|||||||
var fragMap = make(map[string][][]byte)
|
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
|
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)
|
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() {
|
if f.IsDir() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -157,7 +157,7 @@ func (list SFileList) JSTmplInit() error {
|
|||||||
data = replace(data, "};", "}")
|
data = replace(data, "};", "}")
|
||||||
data = replace(data, ";;", ";")
|
data = replace(data, ";;", ";")
|
||||||
|
|
||||||
path = strings.TrimPrefix(path, "tmpl_gen/")
|
path = strings.TrimPrefix(path, "tmpl_client/")
|
||||||
tmplName := strings.TrimSuffix(path, ".go")
|
tmplName := strings.TrimSuffix(path, ".go")
|
||||||
fragset, ok := fragMap[strings.TrimPrefix(tmplName, "template_")]
|
fragset, ok := fragMap[strings.TrimPrefix(tmplName, "template_")]
|
||||||
if !ok {
|
if !ok {
|
||||||
@ -174,7 +174,7 @@ func (list SFileList) JSTmplInit() error {
|
|||||||
|
|
||||||
path = tmplName + ".js"
|
path = tmplName + ".js"
|
||||||
DebugLog("js path: ", path)
|
DebugLog("js path: ", path)
|
||||||
var ext = filepath.Ext("/tmpl_gen/" + path)
|
var ext = filepath.Ext("/tmpl_client/" + path)
|
||||||
gzipData := compressBytesGzip(data)
|
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)})
|
list.Set("/static/"+path, SFile{data, gzipData, 0, int64(len(data)), int64(len(gzipData)), mime.TypeByExtension(ext), f, f.ModTime().UTC().Format(http.TimeFormat)})
|
||||||
|
@ -316,7 +316,7 @@ func CompileJSTemplates() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
var dirPrefix = "./tmpl_gen/"
|
var dirPrefix = "./tmpl_client/"
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
var writeTemplate = func(name string, content string) {
|
var writeTemplate = func(name string, content string) {
|
||||||
log.Print("Writing template '" + name + "'")
|
log.Print("Writing template '" + name + "'")
|
||||||
|
1
tmpl_client/filler.txt
Normal file
1
tmpl_client/filler.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
This file is here so that Git will include this folder in the repository.
|
Loading…
Reference in New Issue
Block a user