setup: retry postinstall commands 3 times

This commit is contained in:
Abdullah Atta
2024-04-26 15:17:49 +05:00
parent a92b34b81c
commit daafeb2fa8

View File

@@ -153,7 +153,15 @@ async function bootstrapPackage(cwd, outputs) {
postInstallCommands.push(`npm run postinstall `);
for (const cmd of postInstallCommands) {
await execute(cmd, cwd, outputs);
let retries = 3;
while (retries > 0) {
try {
await execute(cmd, cwd, outputs);
break;
} catch (e) {
console.error(e);
}
}
}
}