(repositoryUrl: string)
| 97 | } |
| 98 | |
| 99 | async function findExistingGitHubProject(repositoryUrl: string) { |
| 100 | const projects = listProjects(getDesktopWorkingDirectory()) |
| 101 | |
| 102 | for (const project of projects) { |
| 103 | if (isSameGitHubRepository(project.repoOriginUrl, repositoryUrl)) { |
| 104 | return project.id |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | for (const project of projects) { |
| 109 | if (!(await isGitRepository(project.id))) { |
| 110 | continue |
| 111 | } |
| 112 | |
| 113 | const originUrl = await getOriginUrl(project.id) |
| 114 | if (isSameGitHubRepository(originUrl, repositoryUrl)) { |
| 115 | setProjectRepoOrigin(project.id, originUrl) |
| 116 | return project.id |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | return null |
| 121 | } |
| 122 | |
| 123 | export async function createProjectFromGitHubUrl(options: { |
| 124 | preferredProjectLocation: string | null |
no test coverage detected