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

Function addExistingRepositoryProject

desktop/project-create.ts:83–97  ·  view source on GitHub ↗
(projectPath: string, repositoryUrl: string)

Source from the content-addressed store, hash-verified

81}
82
83async 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
99async function findExistingGitHubProject(repositoryUrl: string) {
100 const projects = listProjects(getDesktopWorkingDirectory())

Callers 1

Calls 7

isGitRepositoryFunction · 0.90
getOriginUrlFunction · 0.90
isSameGitHubRepositoryFunction · 0.90
ensureProjectFunction · 0.90
setProjectRepoOriginFunction · 0.90
moveProjectToTopFunction · 0.90
directoryExistsFunction · 0.85

Tested by

no test coverage detected