@@ -134,9 +134,9 @@ func replaceServerConf() {
134
134
logger .Fatal ("read file [" + path + "] failed: " + err .Error ())
135
135
}
136
136
content := string (data )
137
- content = strings .Replace (content , "${Server} " , model .Conf .Server , - 1 )
138
- content = strings .Replace (content , "${StaticServer} " , model .Conf .StaticServer , - 1 )
139
- writePath := strings .TrimRight (path , ".tpl" )
137
+ content = strings .Replace (content , "http://server.tpl.json " , model .Conf .Server , - 1 )
138
+ content = strings .Replace (content , "http://staticserver.tpl.json " , model .Conf .StaticServer , - 1 )
139
+ writePath := strings .TrimSuffix (path , ".tpl" )
140
140
if e = ioutil .WriteFile (writePath , []byte (content ), 0644 ); nil != e {
141
141
logger .Fatal ("replace server conf in [" + writePath + "] failed: " + err .Error ())
142
142
}
@@ -145,15 +145,15 @@ func replaceServerConf() {
145
145
146
146
if util .File .IsExist ("console/dist/" ) { // not exist if npm run dev
147
147
err = filepath .Walk (filepath .ToSlash ("console/dist/" ), func (path string , f os.FileInfo , err error ) error {
148
- if strings .HasSuffix (path , ".html" ) {
148
+ if strings .HasSuffix (path , ".html.tpl " ) {
149
149
data , e := ioutil .ReadFile (path )
150
150
if nil != e {
151
151
logger .Fatal ("read file [" + path + "] failed: " + err .Error ())
152
152
}
153
153
content := string (data )
154
- content = strings .Replace (content , "${Server} " , model .Conf .Server , - 1 )
155
- content = strings .Replace (content , "${StaticServer} " , model .Conf .StaticServer , - 1 )
156
- writePath := strings .TrimRight (path , ".tpl" )
154
+ content = strings .Replace (content , "http://server.tpl.json " , model .Conf .Server , - 1 )
155
+ content = strings .Replace (content , "http://staticserver.tpl.json " , model .Conf .StaticServer , - 1 )
156
+ writePath := strings .TrimSuffix (path , ".tpl" )
157
157
if e = ioutil .WriteFile (writePath , []byte (content ), 0644 ); nil != e {
158
158
logger .Fatal ("replace server conf in [" + writePath + "] failed: " + err .Error ())
159
159
}
0 commit comments