2
0
mirror of https://github.com/iconify/iconify.git synced 2024-12-12 13:47:49 +00:00

fix: miss

This commit is contained in:
DaoYuan 2023-02-07 23:35:49 +08:00
parent 3107db9488
commit 27911a5447

View File

@ -8,7 +8,7 @@ const tasks: Record<string, Promise<void> | undefined> = {};
export async function tryInstallPkg(
name: string,
autoInstall = true
autoInstall: boolean | ((name: string) => Promise<void | undefined>)
): Promise<void | undefined> {
if (pending) {
await pending;
@ -18,8 +18,7 @@ export async function tryInstallPkg(
// eslint-disable-next-line no-console
console.log(cyan(`Installing ${name}...`));
if (typeof autoInstall === 'function') {
tasks[name] = pending = autoInstall
.customInstall(name)
tasks[name] = pending = autoInstall(name)
.then(() => sleep(300))
.finally(() => {
pending = undefined;