172
}
173
174
>
async function isAlpineLinux(fileService: IFileService, logService: ILogService): Promise<boolean> {
extensionManagementUtil.ts
175
>
if (!isLinux) {
176
return false;
177
}
179
>
try {
180
>
const fileContent = await fileService.readFile(URI.file('/etc/os-release'));
181
content = fileContent.value.toString();
183
>
try {
184
>
const fileContent = await fileService.readFile(URI.file('/usr/lib/os-release'));
185
content = fileContent.value.toString();
187
>
/* Ignore */
188
>
logService.debug(`Error while getting the os-release file.`, getErrorMessage(error));
189
>
}
190
>
}
191
>
return !!content && (content.match(/^ID=([^\u001b\r\n]*)/m) || [])[1] === 'alpine';
192
>
}
193
194
>
export async function computeTargetPlatform(fileService: IFileService, logService: ILogService): Promise<TargetPlatform> {
extensionManagementUtil.ts
195
>
const alpineLinux = await isAlpineLinux(fileService, logService);
196
>
const targetPlatform = getTargetPlatform(alpineLinux ? 'alpine' : platform, arch);
197
>
logService.debug('ComputeTargetPlatform:', targetPlatform);
198
>
return targetPlatform;
199
>
}
200
201
export function isMalicious(identifier: IExtensionIdentifier, malicious: ReadonlyArray<MaliciousExtensionInfo>): boolean {