(root string)
| 401 | } |
| 402 | |
| 403 | func resolveBlastRadiusRoot(root string) (string, func(), error) { |
| 404 | cleanup := func() {} |
| 405 | _, localErr := os.Stat(root) |
| 406 | if isGitHubURL(root) { |
| 407 | if os.IsNotExist(localErr) { |
| 408 | repoName := extractRepoName(root) |
| 409 | tempDir, err := cloneRepo(root, repoName) |
| 410 | if err != nil { |
| 411 | return "", cleanup, err |
| 412 | } |
| 413 | cleanup = func() { _ = os.RemoveAll(tempDir) } |
| 414 | root = tempDir |
| 415 | } else if localErr != nil { |
| 416 | return "", cleanup, localErr |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | absRoot, err := filepath.Abs(root) |
| 421 | if err != nil { |
| 422 | return "", cleanup, err |
| 423 | } |
| 424 | return absRoot, cleanup, nil |
| 425 | } |
| 426 | |
| 427 | func buildBlastRadiusBundle(absRoot, ref string, limits blastRadiusLimits) (blastRadiusBundle, error) { |
| 428 | diffInfo, err := scanner.GitDiffInfo(absRoot, ref) |
no test coverage detected