use filepath.Join wrapper for different embed and os path styles

If using internal, "/" is used as a separator always, and with external,
filepath.Join is used.
This commit is contained in:
Harvey Tindall
2021-02-12 14:59:35 +00:00
parent 873afb47cd
commit a6a7710a79
6 changed files with 24 additions and 9 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ func (app *appContext) loadHTML(router *gin.Engine) {
for i, f := range htmlFiles {
if _, err := os.Stat(filepath.Join(customPath, f.Name())); os.IsNotExist(err) {
app.debug.Printf("Using default \"%s\"", f.Name())
loadFiles[i] = filepath.Join(templatePath, f.Name())
loadFiles[i] = FSJoin(templatePath, f.Name())
} else {
app.info.Printf("Using custom \"%s\"", f.Name())
loadFiles[i] = filepath.Join(filepath.Join(customPath, f.Name()))