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

Function setProjectOrigin

desktop/project-git/commit-actions.ts:19–32  ·  view source on GitHub ↗
(projectId: string, repoUrl: string)

Source from the content-addressed store, hash-verified

17}
18
19export async function setProjectOrigin(projectId: string, repoUrl: string) {
20 if (!(await isGitRepository(projectId))) {
21 return
22 }
23
24 const currentOriginUrl = await getOriginUrl(projectId)
25
26 if (currentOriginUrl) {
27 await runGit(projectId, ['remote', 'set-url', 'origin', repoUrl])
28 return
29 }
30
31 await runGit(projectId, ['remote', 'add', 'origin', repoUrl])
32}
33
34export async function commitProjectChanges(
35 projectId: string,

Callers 1

Calls 3

isGitRepositoryFunction · 0.90
getOriginUrlFunction · 0.90
runGitFunction · 0.90

Tested by

no test coverage detected