(input: WorkspaceApplyPatchInput)
| 277 | } |
| 278 | |
| 279 | async applyPatch(input: WorkspaceApplyPatchInput): Promise<WorkspaceApplyPatchResult> { |
| 280 | if (input.action !== 'update') { |
| 281 | const path = await resolveDirectoryEntryPathInScope( |
| 282 | input.cwd, |
| 283 | input.path, |
| 284 | input.label, |
| 285 | input.scope, |
| 286 | ); |
| 287 | if (input.action === 'create') await createPatchedFile(path, input.diff); |
| 288 | else await fs.unlink(path); |
| 289 | return { ok: true, path }; |
| 290 | } |
| 291 | const path = await resolveExistingPathInScope(input.cwd, input.path, input.label, input.scope); |
| 292 | await updatePatchedFile(path, input.diff); |
| 293 | return { ok: true, path }; |
| 294 | } |
| 295 | |
| 296 | async resolveExistingPath(input: WorkspaceResolvePathInput): Promise<WorkspaceResolvePathResult> { |
| 297 | return { |
nothing calls this directly
no test coverage detected