From f54f613e55e0b749494c4b121e19a8863ca4cb5a Mon Sep 17 00:00:00 2001 From: xmdhs Date: Tue, 30 Jan 2024 22:07:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B8=85=E9=99=A4=E6=97=A7?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E8=B7=AF=E5=BE=84=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- launcher/arguments.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/launcher/arguments.go b/launcher/arguments.go index 52f7d9a..0de425e 100644 --- a/launcher/arguments.go +++ b/launcher/arguments.go @@ -207,6 +207,17 @@ func (g *Gameinfo) legacy(l *launcher1155) error { group, _ := errgroup.WithContext(context.TODO()) group.SetLimit(8) + deldir := "" + if a.Virtual { + deldir = p + } else { + deldir = filepath.Join(g.Gamedir, "/resources/") + } + err = os.RemoveAll(deldir) + if err != nil { + return err + } + for path, v := range a.Objects { path, v := path, v group.Go(func() error { @@ -223,10 +234,6 @@ func (g *Gameinfo) legacy(l *launcher1155) error { } } dir := filepath.Dir(copyPath) - err = os.RemoveAll(dir) - if err != nil { - return err - } err = os.MkdirAll(dir, 0777) if err != nil { return err