(shellServer: ShellServer)
| 409 | } |
| 410 | |
| 411 | export async function getOSRelease(shellServer: ShellServer) { |
| 412 | let hardware = 'unknown'; |
| 413 | let id = 'unknown'; |
| 414 | let version = 'unknown'; |
| 415 | try { |
| 416 | hardware = (await shellServer.exec('uname -m')).stdout.trim(); |
| 417 | const { stdout } = await shellServer.exec('(cat /etc/os-release || cat /usr/lib/os-release) 2>/dev/null'); |
| 418 | id = (stdout.match(/^ID=([^\u001b\r\n]*)/m) || [])[1] || 'notfound'; |
| 419 | version = (stdout.match(/^VERSION_ID=([^\u001b\r\n]*)/m) || [])[1] || 'notfound'; |
| 420 | } catch (err) { |
| 421 | console.error(err); |
| 422 | // Optimistically continue. |
| 423 | } |
| 424 | return { hardware, id, version }; |
| 425 | } |
| 426 | |
| 427 | async function runPostCreateCommand(params: ResolverParameters, lifecycleCommandOriginMap: LifecycleHooksInstallMap, containerProperties: ContainerProperties, postCommandName: 'onCreateCommand' | 'updateContentCommand' | 'postCreateCommand', remoteEnv: Promise<Record<string, string>>, secrets: Promise<Record<string, string>>, rerun: boolean) { |
| 428 | const markerFile = path.posix.join(containerProperties.userDataFolder, `.${postCommandName}Marker`); |
no test coverage detected