MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / findExistingGitHubProject

Function findExistingGitHubProject

desktop/project-create.ts:99–121  ·  view source on GitHub ↗
(repositoryUrl: string)

Source from the content-addressed store, hash-verified

97}
98
99async 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
123export async function createProjectFromGitHubUrl(options: {
124 preferredProjectLocation: string | null

Callers 1

Calls 6

listProjectsFunction · 0.90
isSameGitHubRepositoryFunction · 0.90
isGitRepositoryFunction · 0.90
getOriginUrlFunction · 0.90
setProjectRepoOriginFunction · 0.90

Tested by

no test coverage detected