Remove redundant code for syncing asset files

This commit is contained in:
Max 2024-03-13 20:16:13 +08:00
parent 76b78e2102
commit 72d88cddc4

View file

@ -67,13 +67,8 @@ func (tmpl *Template) SyncAssetFile(file string, option *core.BuildOption) error
log.Error("SyncAssets: Get the public root error: %s. use %s", err.Error(), tmpl.local.DSL.Public.Root)
root = tmpl.local.DSL.Public.Root
}
targetRoot := filepath.Join(application.App.Root(), "public", root, "assets")
if exist, _ := os.Stat(targetRoot); exist == nil {
os.MkdirAll(targetRoot, os.ModePerm)
}
os.RemoveAll(targetRoot)
sourceFile := filepath.Join(sourceRoot, file)
targetFile := filepath.Join(targetRoot, file)