MCPcopy Index your code
hub / github.com/nikivdev/go / pullRequestCloneDestination

Function pullRequestCloneDestination

cli/flow/main.go:1446–1462  ·  view source on GitHub ↗
(repo string, prNumber int)

Source from the content-addressed store, hash-verified

1444}
1445
1446func pullRequestCloneDestination(repo string, prNumber int) (string, error) {
1447 if prNumber <= 0 {
1448 return "", fmt.Errorf("invalid pull request number %d", prNumber)
1449 }
1450
1451 repoName := strings.TrimSuffix(filepath.Base(repo), ".git")
1452 if strings.TrimSpace(repoName) == "" {
1453 return "", fmt.Errorf("invalid repository name %q", repo)
1454 }
1455
1456 homeDir, err := os.UserHomeDir()
1457 if err != nil {
1458 return "", fmt.Errorf("determine home directory: %w", err)
1459 }
1460
1461 return filepath.Join(homeDir, "pr", fmt.Sprintf("%s-pr%d", repoName, prNumber)), nil
1462}
1463
1464func openInCursor(ctx *snap.Context, path string) error {
1465 cursorApp := "/Applications/Cursor.app"

Callers 1

runClonePRFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected