From 75ca0557725abacafbcc3edb712913346ae4a876 Mon Sep 17 00:00:00 2001 From: fancl Date: Fri, 13 Dec 2024 16:31:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E5=99=A8=E5=8E=BB=E9=99=A4?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E7=9A=84=E7=94=9F=E6=88=90=E7=9A=84=E5=8C=85?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generator/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generator/main.go b/generator/main.go index c198192..2a22277 100644 --- a/generator/main.go +++ b/generator/main.go @@ -75,7 +75,11 @@ func extractFile(file string, dirname string) (err error) { prefix = header.Name 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 err = os.MkdirAll(filename, 0755); err != nil { return