(modCount int)
| 320 | } |
| 321 | |
| 322 | func (a *App) waitForTestResult(modCount int) bool { |
| 323 | if a.AutoLaunchGame { |
| 324 | prismPath, err := findPrismLauncher() |
| 325 | if err != nil { |
| 326 | a.emitLog(fmt.Sprintf("Failed to launch Prism Launcher: %v", err), LogError) |
| 327 | wailsRuntime.EventsEmit(a.ctx, "test-group-prompt", map[string]interface{}{ |
| 328 | "count": modCount, |
| 329 | "auto_launch": false, |
| 330 | }) |
| 331 | result := <-a.testResultChan |
| 332 | return result |
| 333 | } |
| 334 | instanceName := a.getInstanceName() |
| 335 | cmd := exec.Command(prismPath, "-l", instanceName) |
| 336 | if err := cmd.Start(); err != nil { |
| 337 | a.emitLog(fmt.Sprintf("Failed to launch Prism Launcher: %v", err), LogError) |
| 338 | wailsRuntime.EventsEmit(a.ctx, "test-group-prompt", map[string]interface{}{ |
| 339 | "count": modCount, |
| 340 | "auto_launch": false, |
| 341 | }) |
| 342 | result := <-a.testResultChan |
| 343 | return result |
| 344 | } |
| 345 | defer func() { |
| 346 | cmd.Process.Kill() |
| 347 | time.Sleep(500 * time.Millisecond) |
| 348 | }() |
| 349 | } |
| 350 | |
| 351 | wailsRuntime.EventsEmit(a.ctx, "test-group-prompt", map[string]interface{}{ |
| 352 | "count": modCount, |
| 353 | "auto_launch": a.AutoLaunchGame, |
| 354 | }) |
| 355 | result := <-a.testResultChan |
| 356 | return result |
| 357 | } |
| 358 | |
| 359 | func (a *App) getInstanceName() string { |
| 360 | return filepath.Base(filepath.Dir(filepath.Dir(a.ProjectData.ModsDir))) |
no test coverage detected