fix: install-deps did not throw on non 0 exit code (#12375)

This commit is contained in:
Max Schmitt 2022-02-26 00:45:27 +01:00 committed by GitHub
parent 3c2bca2768
commit 41e9b36f63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,8 +78,8 @@ export async function installDependenciesLinux(targets: Set<DependencyGroup>, dr
if (elevatedPermissions)
console.log('Switching to root user to install dependencies...'); // eslint-disable-line no-console
const child = childProcess.spawn(command, args, { stdio: 'inherit' });
await new Promise((resolve, reject) => {
child.on('exit', resolve);
await new Promise<void>((resolve, reject) => {
child.on('exit', (code: number) => code === 0 ? resolve() : reject(new Error(`Installation process exited with code: ${code}`)));
child.on('error', reject);
});
}