MCPcopy
hub / github.com/coder/mux / copyPersistentConfig

Function copyPersistentConfig

src/cli/workflow.ts:197–217  ·  view source on GitHub ↗
(realConfig: Config, config: Config)

Source from the content-addressed store, hash-verified

195}
196
197async function copyPersistentConfig(realConfig: Config, config: Config): Promise<void> {
198 const existingProviders = realConfig.loadProvidersConfig();
199 if (existingProviders != null && hasAnyConfiguredProvider(existingProviders)) {
200 config.saveProvidersConfig(existingProviders);
201 }
202 const existingSecrets = realConfig.loadSecretsConfig();
203 if (Object.keys(existingSecrets).length > 0) {
204 await config.saveSecretsConfig(existingSecrets);
205 }
206
207 const existingConfig = realConfig.loadConfigOrDefault();
208 const trustOnlyProjects = new Map<string, ProjectConfig>();
209 for (const [projectPath, projectConfig] of existingConfig.projects) {
210 if (projectConfig.trusted !== undefined) {
211 trustOnlyProjects.set(projectPath, { workspaces: [], trusted: projectConfig.trusted });
212 }
213 }
214 if (trustOnlyProjects.size > 0) {
215 await config.saveConfig({ ...config.loadConfigOrDefault(), projects: trustOnlyProjects });
216 }
217}
218
219function buildExperimentsObject(experimentIds: readonly string[]) {
220 return {

Callers 1

createWorkflowContextFunction · 0.85

Calls 8

hasAnyConfiguredProviderFunction · 0.90
loadProvidersConfigMethod · 0.80
saveProvidersConfigMethod · 0.80
loadSecretsConfigMethod · 0.80
saveSecretsConfigMethod · 0.80
loadConfigOrDefaultMethod · 0.80
setMethod · 0.80
saveConfigMethod · 0.80

Tested by

no test coverage detected