( project: ProjectGuardInput, action: string )
| 11 | repoDeletedAt: Date | null; |
| 12 | }; |
| 13 | |
| 14 | export function ensureProjectIsMutable( |
| 15 | project: ProjectGuardInput, |
| 16 | action: string |
| 17 | ): void { |
| 18 | if (!project.archivedAt) return; |
| 19 | |
| 20 | if (project.repoDeletedAt) { |
| 21 | throw new ValidationError( |
| 22 | `Project "${project.name}" is archived and its local repository files were deleted. Rebind repoPath and restore it before trying to ${action}.` |
| 23 | ); |
| 24 | } |
| 25 | |
| 26 | throw new ValidationError( |
| 27 | `Project "${project.name}" is archived. Restore it before trying to ${action}.` |
| 28 | ); |
| 29 | } |
| 30 | |
| 31 | export function ensureProjectHasRepository( |
no outgoing calls
no test coverage detected