mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-06 07:39:48 +02:00
Terminate build in CI if download fails
This commit is contained in:
@@ -19,6 +19,10 @@ async function download(url: string, fileName: URL) {
|
|||||||
await writeFile(fileName, Buffer.from(await image.arrayBuffer()));
|
await writeFile(fileName, Buffer.from(await image.arrayBuffer()));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('failed to load', url, error);
|
console.error('failed to load', url, error);
|
||||||
|
// Exit the build process if we are in CI
|
||||||
|
if (process.env.CI) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +36,7 @@ async function fetchAvatars() {
|
|||||||
download(`https://github.com/${name}.png?size=100`, getAvatarPath(name));
|
download(`https://github.com/${name}.png?size=100`, getAvatarPath(name));
|
||||||
});
|
});
|
||||||
|
|
||||||
await Promise.all(avatars);
|
await Promise.allSettled(avatars);
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAvatars();
|
fetchAvatars();
|
||||||
|
Reference in New Issue
Block a user