MCPcopy Index your code
hub / github.com/devcontainers/cli / outdated

Function outdated

src/spec-node/devContainersSpecCLI.ts:1171–1248  ·  view source on GitHub ↗
({
	// 'user-data-folder': persistedFolder,
	'workspace-folder': workspaceFolderArg,
	config: configParam,
	'output-format': outputFormat,
	'log-level': logLevel,
	'log-format': logFormat,
	'terminal-rows': terminalRows,
	'terminal-columns': terminalColumns,
}: OutdatedArgs)

Source from the content-addressed store, hash-verified

1169}
1170
1171async function outdated({
1172 // 'user-data-folder': persistedFolder,
1173 'workspace-folder': workspaceFolderArg,
1174 config: configParam,
1175 'output-format': outputFormat,
1176 'log-level': logLevel,
1177 'log-format': logFormat,
1178 'terminal-rows': terminalRows,
1179 'terminal-columns': terminalColumns,
1180}: OutdatedArgs) {
1181 const disposables: (() => Promise<unknown> | undefined)[] = [];
1182 const dispose = async () => {
1183 await Promise.all(disposables.map(d => d()));
1184 };
1185 let output: Log | undefined;
1186 try {
1187 const workspaceFolder = workspaceFolderArg ? path.resolve(process.cwd(), workspaceFolderArg) : process.cwd();
1188 const configFile = configParam ? URI.file(path.resolve(process.cwd(), configParam)) : undefined;
1189 const cliHost = await getCLIHost(workspaceFolder, loadNativeModule, logFormat === 'text');
1190 const extensionPath = path.join(__dirname, '..', '..');
1191 const sessionStart = new Date();
1192 const pkg = getPackageConfig();
1193 output = createLog({
1194 logLevel: mapLogLevel(logLevel),
1195 logFormat,
1196 log: text => process.stderr.write(text),
1197 terminalDimensions: terminalColumns && terminalRows ? { columns: terminalColumns, rows: terminalRows } : undefined,
1198 }, pkg, sessionStart, disposables);
1199
1200 const workspace = workspaceFromPath(cliHost.path, workspaceFolder);
1201 const configPath = configFile ? configFile : await getDevContainerConfigPathIn(cliHost, workspace.configFolderPath);
1202 const configs = configPath && await readDevContainerConfigFile(cliHost, workspace, configPath, true, false, output) || undefined;
1203 if (!configs) {
1204 throw new ContainerError({ description: `Dev container config (${uriToFsPath(configFile || getDefaultDevContainerConfigPath(cliHost, workspace!.configFolderPath), cliHost.platform)}) not found.` });
1205 }
1206
1207 const cacheFolder = await getCacheFolder(cliHost);
1208 const params = {
1209 extensionPath,
1210 cacheFolder,
1211 cwd: cliHost.cwd,
1212 output,
1213 env: cliHost.env,
1214 skipFeatureAutoMapping: false,
1215 platform: cliHost.platform,
1216 };
1217
1218 const outdated = await loadVersionInfo(params, configs.config.config);
1219 await new Promise<void>((resolve, reject) => {
1220 let text;
1221 if (outputFormat === 'text') {
1222 const rows = Object.keys(outdated.features).map(key => {
1223 const value = outdated.features[key];
1224 return [ getFeatureIdWithoutVersion(key), value.current, value.wanted, value.latest ]
1225 .map(v => v === undefined ? '-' : v);
1226 });
1227 const header = ['Feature', 'Current', 'Wanted', 'Latest'];
1228 text = textTable([

Callers

nothing calls this directly

Calls 15

getCLIHostFunction · 0.90
getPackageConfigFunction · 0.90
createLogFunction · 0.90
mapLogLevelFunction · 0.90
workspaceFromPathFunction · 0.90
uriToFsPathFunction · 0.90
getCacheFolderFunction · 0.90
loadVersionInfoFunction · 0.90

Tested by

no test coverage detected