src/vs/base/node/osReleaseInfo.ts

74 LOC · 63 covered · 11 uncovered · 6 ranges · 9 concepts · 2 introducers · 17 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the filesrc/vs/platform/sandbox/node/sandboxHelper.ts · 167 LOCnode/sandboxHelper.tsosReleaseInfo.ts ×5 · 54 introduced LOCosReleaseInfo.ts ×5sandboxHelper.ts ×1 · 2 introduced LOCsandboxHelper.ts ×1sandboxHelper.ts ×1 · 2 introduced LOCsandboxHelper.ts ×1sandboxHelper.ts ×1 · 5 introduced LOCsandboxHelper.ts ×1sandboxHelper.ts ×4 · 7 introduced LOCsandboxHelper.ts ×4sandboxHelper.ts ×1 · 1 introduced LOCsandboxHelper.ts ×1sandboxHelper.ts ×1 · 6 introduced LOCsandboxHelper.ts ×1sandboxHelper.ts ×1 · 2 introduced LOCsandboxHelper.ts ×1sandboxHelper.ts ×12 · 74 introduced LOCsandboxHelper.ts ×12sandboxHelper.test|title=SandboxHelperService detects apk for dependency installation|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService detects apk for dependency installation|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService detects apt for dependency installation|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService detects apt for dependency installation|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService detects apt-get for dependency installation|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService detects apt-get for dependency installation|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService detects dnf for dependency installation|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService detects dnf for dependency installation|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService detects pacman for dependency installation|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService detects pacman for dependency installation|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService detects yum for dependency installation|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService detects yum for dependency installation|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService detects zypper for dependency installation|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService detects zypper for dependency installation|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService does not inspect sandbox dependencies on non-Linux platforms|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService does not inspect sandbox dependencies on non-Linux platforms|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService does not offer dependency installation to a non-root user without sudo|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService does not offer dependency installation to a non-root user without sudo|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService does not offer dependency installation without a supported package manager|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService does not offer dependency installation without a supported package manager|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService does not use sudo for chained apt-get commands when running as root|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService does not use sudo for chained apt-get commands when running as root|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService does not use sudo when running as root|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService does not use sudo when running as root|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService reports bubblewrap usable when its capability probe succeeds|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService reports bubblewrap usable when its capability probe succeeds|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService reports missing bubblewrap without running its capability probe|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService reports missing bubblewrap without running its capability probe|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService reports the probe error when bubblewrap is unusable|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService reports the probe error when bubblewrap is unusable|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService uses ID_LIKE to detect a derivative distribution|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService uses ID_LIKE to detect a derivative distribution|occurrence=1sandboxHelper.test|title…sandboxHelper.test|title=SandboxHelperService uses the native package manager when multiple managers are available|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/sandbox/test/node/sandboxHelper.test|title=SandboxHelperService uses the native package manager when multiple managers are available|occurrence=1sandboxHelper.test|title…Focused file · src/vs/base/node/osReleaseInfo.ts · 74 LOCnode/osReleaseInfo.ts

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- sandboxHelper.ts ×12
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { constants as FSConstants, promises as FSPromises } from 'fs';
7 > import { createInterface as readLines } from 'readline';
8 > import * as Platform from '../common/platform.js';
9 >
10 > type ReleaseInfo = {
11 > id: string;
12 > id_like?: string;
13 > version_id?: string;
14 > };
15 >
16 > export async function getOSReleaseInfo(errorLogger: (error: string | Error) => void): Promise<ReleaseInfo | undefined> { osReleaseInfo.ts ×5
17 > if (Platform.isMacintosh || Platform.isWindows) {
18 return;
19 }
21 > // Extract release information on linux based systems
22 > // using the identifiers specified in
23 > // https://www.freedesktop.org/software/systemd/man/os-release.html
24 > let handle: FSPromises.FileHandle | undefined;
25 > for (const filePath of ['/etc/os-release', '/usr/lib/os-release', '/etc/lsb-release']) {
26 > try {
27 > handle = await FSPromises.open(filePath, FSConstants.R_OK);
28 > break;
29 > } catch (err) { }
30 > }
31 >
32 > if (!handle) {
33 errorLogger('Unable to retrieve release information from known identifier paths.');
34 return;
35 }
37 > try {
38 > const osReleaseKeys = new Set([
39 > 'ID',
40 > 'DISTRIB_ID',
41 > 'ID_LIKE',
42 > 'VERSION_ID',
43 > 'DISTRIB_RELEASE',
44 > ]);
45 > const releaseInfo: ReleaseInfo = {
46 > id: 'unknown'
47 > };
48 >
49 > for await (const line of readLines({ input: handle.createReadStream(), crlfDelay: Infinity })) {
50 > if (!line.includes('=')) {
51 continue;
52 }
53 > const key = line.split('=')[0].toUpperCase().trim(); osReleaseInfo.ts ×5
54 > if (osReleaseKeys.has(key)) {
55 > const value = line.split('=')[1].replace(/"/g, '').toLowerCase().trim();
56 > if (key === 'ID' || key === 'DISTRIB_ID') {
57 > releaseInfo.id = value;
58 > } else if (key === 'ID_LIKE') {
59 > releaseInfo.id_like = value;
60 > } else if (key === 'VERSION_ID' || key === 'DISTRIB_RELEASE') {
61 > releaseInfo.version_id = value;
62 > }
63 > }
64 > }
65 >
66 > return releaseInfo;
67 > } catch (err) {
68 errorLogger(err);
69 > } finally { osReleaseInfo.ts ×5
70 > await handle.close();
71 > }
72
73 return;
74 }