Skip to content

Commit

Permalink
修复清除旧资源路径的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
xmdhs committed Jan 30, 2024
1 parent f3b2204 commit f54f613
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions launcher/arguments.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit f54f613

Please sign in to comment.