生成器去除默认的生成的包名称

This commit is contained in:
fancl 2024-12-13 16:31:32 +08:00
parent 7d1ecab9fb
commit 75ca055772
1 changed files with 5 additions and 1 deletions

View File

@ -75,7 +75,11 @@ func extractFile(file string, dirname string) (err error) {
prefix = header.Name prefix = header.Name
continue continue
} }
filename := path.Join(dirname, strings.TrimPrefix(header.Name, prefix)) realname := strings.TrimPrefix(header.Name, prefix)
if strings.HasPrefix(realname, "generator") {
continue
}
filename := path.Join(dirname, realname)
if header.Typeflag == tar.TypeDir { if header.Typeflag == tar.TypeDir {
if err = os.MkdirAll(filename, 0755); err != nil { if err = os.MkdirAll(filename, 0755); err != nil {
return return