MCPcopy Create free account
hub / github.com/agent-tower/core / update

Method update

packages/server/src/services/project.service.ts:366–391  ·  view source on GitHub ↗

* 更新项目

(id: string, input: UpdateProjectInput)

Source from the content-addressed store, hash-verified

364 input.initEmptyRepo ?? false
365 );
366
367 try {
368 const capability = await detectProjectGitCapability(resolvedPath);
369 const gitCapabilityCheckedAt = new Date();
370 const created = await prisma.project.create({
371 data: {
372 name: input.name,
373 description: input.description,
374 repoPath: resolvedPath,
375 repoRemoteUrl,
376 mainBranch: input.mainBranch || 'main',
377 copyFiles: input.copyFiles,
378 setupScript: input.setupScript,
379 quickCommands: input.quickCommands,
380 isGitRepo: capability.isGitRepo,
381 worktreeReady: capability.worktreeReady,
382 gitCapabilityReason: capability.reason,
383 gitCapabilityCheckedAt,
384 },
385 });
386 return this.withGitMetadata(created);
387 } catch (error) {
388 if (initialized) {
389 await removeGitMetadata(resolvedPath);
390 }
391 throw error;
392 }
393 }
394

Callers 3

projectRoutesFunction · 0.95
archiveMethod · 0.45
restoreMethod · 0.45

Calls 2

withGitMetadataMethod · 0.95
ensureProjectIsMutableFunction · 0.85

Tested by

no test coverage detected