MCPcopy Index your code
hub / github.com/coder/mux / copyIfExists

Function copyIfExists

src/node/services/workspaceService.ts:779–787  ·  view source on GitHub ↗
(sourcePath: string, destinationPath: string)

Source from the content-addressed store, hash-verified

777}
778
779async function copyIfExists(sourcePath: string, destinationPath: string): Promise<void> {
780 try {
781 await fsPromises.copyFile(sourcePath, destinationPath);
782 } catch (error) {
783 if (!isErrnoWithCode(error, "ENOENT")) {
784 throw error;
785 }
786 }
787}
788
789async function resetForkedSessionUsage(
790 sessionUsageService: SessionUsageService | undefined,

Callers 1

forkMethod · 0.85

Calls 1

isErrnoWithCodeFunction · 0.90

Tested by

no test coverage detected