({
// 'user-data-folder': persistedFolder,
'docker-path': dockerPath,
'docker-compose-path': dockerComposePath,
'workspace-folder': workspaceFolderArg,
'mount-workspace-git-root': mountWorkspaceGitRoot,
'mount-git-worktree-common-dir': mountGitWorktreeCommonDir,
config: configParam,
'override-config': overrideConfig,
'container-id': containerId,
'id-label': idLabel,
'log-level': logLevel,
'log-format': logFormat,
'terminal-rows': terminalRows,
'terminal-columns': terminalColumns,
'include-features-configuration': includeFeaturesConfig,
'include-merged-configuration': includeMergedConfig,
'additional-features': additionalFeaturesJson,
'skip-feature-auto-mapping': skipFeatureAutoMapping,
}: ReadConfigurationArgs)
| 1030 | } |
| 1031 | |
| 1032 | async function readConfiguration({ |
| 1033 | // 'user-data-folder': persistedFolder, |
| 1034 | 'docker-path': dockerPath, |
| 1035 | 'docker-compose-path': dockerComposePath, |
| 1036 | 'workspace-folder': workspaceFolderArg, |
| 1037 | 'mount-workspace-git-root': mountWorkspaceGitRoot, |
| 1038 | 'mount-git-worktree-common-dir': mountGitWorktreeCommonDir, |
| 1039 | config: configParam, |
| 1040 | 'override-config': overrideConfig, |
| 1041 | 'container-id': containerId, |
| 1042 | 'id-label': idLabel, |
| 1043 | 'log-level': logLevel, |
| 1044 | 'log-format': logFormat, |
| 1045 | 'terminal-rows': terminalRows, |
| 1046 | 'terminal-columns': terminalColumns, |
| 1047 | 'include-features-configuration': includeFeaturesConfig, |
| 1048 | 'include-merged-configuration': includeMergedConfig, |
| 1049 | 'additional-features': additionalFeaturesJson, |
| 1050 | 'skip-feature-auto-mapping': skipFeatureAutoMapping, |
| 1051 | }: ReadConfigurationArgs) { |
| 1052 | const disposables: (() => Promise<unknown> | undefined)[] = []; |
| 1053 | const dispose = async () => { |
| 1054 | await Promise.all(disposables.map(d => d())); |
| 1055 | }; |
| 1056 | let output: Log | undefined; |
| 1057 | try { |
| 1058 | const workspaceFolder = workspaceFolderArg ? path.resolve(process.cwd(), workspaceFolderArg) : undefined; |
| 1059 | const providedIdLabels = idLabel ? Array.isArray(idLabel) ? idLabel as string[] : [idLabel] : undefined; |
| 1060 | const configFile = configParam ? URI.file(path.resolve(process.cwd(), configParam)) : undefined; |
| 1061 | const overrideConfigFile = overrideConfig ? URI.file(path.resolve(process.cwd(), overrideConfig)) : undefined; |
| 1062 | const cwd = workspaceFolder || process.cwd(); |
| 1063 | const cliHost = await getCLIHost(cwd, loadNativeModule, logFormat === 'text'); |
| 1064 | const extensionPath = path.join(__dirname, '..', '..'); |
| 1065 | const sessionStart = new Date(); |
| 1066 | const pkg = getPackageConfig(); |
| 1067 | output = createLog({ |
| 1068 | logLevel: mapLogLevel(logLevel), |
| 1069 | logFormat, |
| 1070 | log: text => process.stderr.write(text), |
| 1071 | terminalDimensions: terminalColumns && terminalRows ? { columns: terminalColumns, rows: terminalRows } : undefined, |
| 1072 | }, pkg, sessionStart, disposables); |
| 1073 | |
| 1074 | const workspace = workspaceFolder ? workspaceFromPath(cliHost.path, workspaceFolder) : undefined; |
| 1075 | const configPath = configFile ? configFile : workspace |
| 1076 | ? (await getDevContainerConfigPathIn(cliHost, workspace.configFolderPath) |
| 1077 | || (overrideConfigFile ? getDefaultDevContainerConfigPath(cliHost, workspace.configFolderPath) : undefined)) |
| 1078 | : overrideConfigFile; |
| 1079 | const configs = configPath && await readDevContainerConfigFile(cliHost, workspace, configPath, mountWorkspaceGitRoot, mountGitWorktreeCommonDir, output, undefined, overrideConfigFile) || undefined; |
| 1080 | if ((configFile || workspaceFolder || overrideConfigFile) && !configs) { |
| 1081 | throw new ContainerError({ description: `Dev container config (${uriToFsPath(configFile || getDefaultDevContainerConfigPath(cliHost, workspace!.configFolderPath), cliHost.platform)}) not found.` }); |
| 1082 | } |
| 1083 | |
| 1084 | let configuration = configs?.config || { |
| 1085 | raw: {}, |
| 1086 | config: {}, |
| 1087 | substitute: value => substitute({ platform: cliHost.platform, env: cliHost.env }, value) |
| 1088 | }; |
| 1089 |
nothing calls this directly
no test coverage detected