check template file exists during setup
This commit is contained in:
parent
3bd248f80f
commit
800567363e
|
@ -24,6 +24,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
uri2 "net/url"
|
uri2 "net/url"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"github.com/valyala/fasttemplate"
|
"github.com/valyala/fasttemplate"
|
||||||
log "github.com/cihub/seelog"
|
log "github.com/cihub/seelog"
|
||||||
|
@ -356,6 +357,11 @@ func (module *Module) initialize(w http.ResponseWriter, r *http.Request, ps http
|
||||||
dslTplFile:=path.Join(global.Env().GetConfigDir(),"initialization.tpl")
|
dslTplFile:=path.Join(global.Env().GetConfigDir(),"initialization.tpl")
|
||||||
dslFile:=path.Join(global.Env().GetConfigDir(),"initialization.dsl")
|
dslFile:=path.Join(global.Env().GetConfigDir(),"initialization.dsl")
|
||||||
|
|
||||||
|
if !util.FileExists(dslTplFile){
|
||||||
|
log.Error(filepath.Abs(dslTplFile))
|
||||||
|
panic("template file for setup was missing")
|
||||||
|
}
|
||||||
|
|
||||||
var dsl []byte
|
var dsl []byte
|
||||||
dsl,err=util.FileGetContent(dslTplFile)
|
dsl,err=util.FileGetContent(dslTplFile)
|
||||||
if err!=nil{
|
if err!=nil{
|
||||||
|
|
Loading…
Reference in New Issue