diff --git a/dist/index.js b/dist/index.js index 59e134b2..5e1657ed 100644 --- a/dist/index.js +++ b/dist/index.js @@ -147263,12 +147263,19 @@ async function checkAptInstallability(packageName) { "--names-only", `'^${packageName}$'`, ]); - return output.stdout.length !== 0; + return output.stdout.length > 0; } async function retrieveInstallableOptionalDependencies(optionalDependencies) { switch (PLATFORM) { case "linux": { - return optionalDependencies.filter(async (dep) => await checkAptInstallability(dep)); + const installableOptionalDependencies = []; + for (const optionalDependency of optionalDependencies) { + const isInstallable = await checkAptInstallability(optionalDependency); + if (isInstallable) { + installableOptionalDependencies.push(optionalDependency); + } + } + return installableOptionalDependencies; } default: { return []; diff --git a/packages/setup-ocaml/src/unix.ts b/packages/setup-ocaml/src/unix.ts index 8a7a1d9f..abb58704 100644 --- a/packages/setup-ocaml/src/unix.ts +++ b/packages/setup-ocaml/src/unix.ts @@ -9,7 +9,7 @@ async function checkAptInstallability(packageName: string) { "--names-only", `'^${packageName}$'`, ]); - return output.stdout.length !== 0; + return output.stdout.length > 0; } async function retrieveInstallableOptionalDependencies( @@ -17,9 +17,14 @@ async function retrieveInstallableOptionalDependencies( ) { switch (PLATFORM) { case "linux": { - return optionalDependencies.filter( - async (dep) => await checkAptInstallability(dep), - ); + const installableOptionalDependencies: string[] = []; + for (const optionalDependency of optionalDependencies) { + const isInstallable = await checkAptInstallability(optionalDependency); + if (isInstallable) { + installableOptionalDependencies.push(optionalDependency); + } + } + return installableOptionalDependencies; } default: { return [];