(
workspaceId: string,
updater: (workspace: WorkspaceConfigEntry) => void,
options?: { allowMissing?: boolean }
)
| 1804 | } |
| 1805 | |
| 1806 | private async editWorkspaceEntry( |
| 1807 | workspaceId: string, |
| 1808 | updater: (workspace: WorkspaceConfigEntry) => void, |
| 1809 | options?: { allowMissing?: boolean } |
| 1810 | ): Promise<boolean> { |
| 1811 | assert(workspaceId.length > 0, "editWorkspaceEntry: workspaceId must be non-empty"); |
| 1812 | |
| 1813 | let found = false; |
| 1814 | await this.config.editConfig((config) => { |
| 1815 | for (const [_projectPath, project] of config.projects) { |
| 1816 | const ws = project.workspaces.find((w) => w.id === workspaceId); |
| 1817 | if (!ws) continue; |
| 1818 | updater(ws); |
| 1819 | found = true; |
| 1820 | return config; |
| 1821 | } |
| 1822 | |
| 1823 | if (options?.allowMissing) { |
| 1824 | return config; |
| 1825 | } |
| 1826 | |
| 1827 | throw new Error(`editWorkspaceEntry: workspace ${workspaceId} not found`); |
| 1828 | }); |
| 1829 | |
| 1830 | return found; |
| 1831 | } |
| 1832 | |
| 1833 | async initialize(): Promise<void> { |
| 1834 | const startupStartedAt = Date.now(); |
no test coverage detected