FIX: Fix bug check diff type
This commit is contained in:
@@ -10,7 +10,7 @@ const ProxyZipFile = "64bit.zip"
|
||||
const LauncherFile = "firefly-launcher.exe"
|
||||
const TempUrl = "./temp"
|
||||
|
||||
const CurrentLauncherVersion = "1.5.0"
|
||||
const CurrentLauncherVersion = "1.5.1"
|
||||
|
||||
type ToolFile string
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user