FIX: Fix bug check diff type

This commit is contained in:
2025-08-26 09:58:30 +07:00
parent 6b222bfa70
commit a021658fa9
4 changed files with 19 additions and 22 deletions

View File

@@ -21,9 +21,18 @@ func IsFileIn7z(archivePath, fileInside string) (bool, error) {
lines := strings.Split(out.String(), "\n")
for _, line := range lines {
if strings.Contains(line, fileInside) {
return true, nil
line = strings.TrimSpace(line)
if line == "" {
continue
}
parts := strings.Fields(line)
if len(parts) > 0 {
path := parts[len(parts)-1]
if path == fileInside {
return true, nil
}
}
}
return false, fmt.Errorf("%s not found in %s", fileInside, archivePath)