1
0
mirror of https://github.com/beego/bee.git synced 2025-06-26 19:10:19 +00:00

Revert "Only contents in "CompareExcept" are excluded during comparison"

This reverts commit a9d3de0872.
This commit is contained in:
askuy
2020-07-27 13:09:56 +08:00
parent a9d3de0872
commit 59fa4ace1e
3 changed files with 19 additions and 35 deletions

View File

@ -130,8 +130,7 @@ func (r *RenderFile) Exec(name string) {
}
// Replace or create when content changes
output := []byte(buf)
ext := filepath.Ext(r.FlushFile)
if r.Option.EnableFormat && ext == ".go" {
if r.Option.EnableFormat && filepath.Ext(r.FlushFile) == ".go" {
// format code
var bts []byte
bts, err = format.Source([]byte(buf))
@ -142,7 +141,7 @@ func (r *RenderFile) Exec(name string) {
output = bts
}
if FileContentChange(orgContent,output,GetSeg(ext)) {
if FileContentChange(orgContent,output) {
err = r.write(r.FlushFile, output)
if err != nil {
beeLogger.Log.Fatalf("Could not create file: %s", err)