(projectPath: string, repositoryUrl: string)
| 81 | } |
| 82 | |
| 83 | async function addExistingRepositoryProject(projectPath: string, repositoryUrl: string) { |
| 84 | if (!((await directoryExists(projectPath)) && (await isGitRepository(projectPath)))) { |
| 85 | return null |
| 86 | } |
| 87 | |
| 88 | const originUrl = await getOriginUrl(projectPath) |
| 89 | if (!isSameGitHubRepository(originUrl, repositoryUrl)) { |
| 90 | return null |
| 91 | } |
| 92 | |
| 93 | ensureProject(projectPath) |
| 94 | setProjectRepoOrigin(projectPath, originUrl ?? repositoryUrl) |
| 95 | moveProjectToTop(projectPath) |
| 96 | return { projectId: projectPath } |
| 97 | } |
| 98 | |
| 99 | async function findExistingGitHubProject(repositoryUrl: string) { |
| 100 | const projects = listProjects(getDesktopWorkingDirectory()) |
no test coverage detected