check template file exists during setup
This commit is contained in:
parent
3bd248f80f
commit
800567363e
|
@ -24,6 +24,7 @@ import (
|
|||
"net/http"
|
||||
uri2 "net/url"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"github.com/valyala/fasttemplate"
|
||||
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")
|
||||
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
|
||||
dsl,err=util.FileGetContent(dslTplFile)
|
||||
if err!=nil{
|
||||
|
|
Loading…
Reference in New Issue