mirror of
https://github.com/beego/bee.git
synced 2025-06-26 19:10:19 +00:00
Only contents in "CompareExcept" are excluded during comparison
This commit is contained in:
@ -130,7 +130,8 @@ func (r *RenderFile) Exec(name string) {
|
||||
}
|
||||
// Replace or create when content changes
|
||||
output := []byte(buf)
|
||||
if r.Option.EnableFormat && filepath.Ext(r.FlushFile) == ".go" {
|
||||
ext := filepath.Ext(r.FlushFile)
|
||||
if r.Option.EnableFormat && ext == ".go" {
|
||||
// format code
|
||||
var bts []byte
|
||||
bts, err = format.Source([]byte(buf))
|
||||
@ -141,7 +142,7 @@ func (r *RenderFile) Exec(name string) {
|
||||
output = bts
|
||||
}
|
||||
|
||||
if FileContentChange(orgContent,output) {
|
||||
if FileContentChange(orgContent,output,GetSeg(ext)) {
|
||||
err = r.write(r.FlushFile, output)
|
||||
if err != nil {
|
||||
beeLogger.Log.Fatalf("Could not create file: %s", err)
|
||||
|
Reference in New Issue
Block a user