FIX: Fix bug check diff type
This commit is contained in:
@@ -18,16 +18,16 @@ import (
|
||||
type DiffService struct{}
|
||||
|
||||
func (h *DiffService) CheckTypeHDiff(patchPath string) (bool, string, string) {
|
||||
if ok, err := sevenzip.IsFileIn7z(patchPath, "manifest"); err == nil && ok {
|
||||
return true, "manifest", ""
|
||||
}
|
||||
|
||||
if ok, err := sevenzip.IsFileIn7z(patchPath, "hdifffiles.txt"); err == nil && ok {
|
||||
return true, "hdifffiles.txt", ""
|
||||
}
|
||||
if ok, err := sevenzip.IsFileIn7z(patchPath, "hdiffmap.json"); err == nil && ok {
|
||||
return true, "hdiffmap.json", ""
|
||||
}
|
||||
if ok, err := sevenzip.IsFileIn7z(patchPath, "manifest"); err == nil && ok {
|
||||
return true, "manifest", ""
|
||||
}
|
||||
|
||||
return false, "", "not found hdifffiles.txt or hdiffmap.json"
|
||||
}
|
||||
|
||||
@@ -155,9 +155,12 @@ func (h *DiffService) DeleteFiles(gamePath string) (bool, string) {
|
||||
}
|
||||
|
||||
if err := scanner.Err(); err != nil {
|
||||
file.Close()
|
||||
return false, "no delete files exist"
|
||||
}
|
||||
|
||||
file.Close()
|
||||
|
||||
for i, file := range deleteFiles {
|
||||
os.Remove(filepath.Join(gamePath, file))
|
||||
application.Get().Event.Emit("diff:progress", map[string]int{"progress": i, "maxProgress": len(deleteFiles)})
|
||||
|
||||
Reference in New Issue
Block a user